Carbunql icon indicating copy to clipboard operation
Carbunql copied to clipboard

[Experiment] TypeSafe Query Builder - Omitting table join expressions

Open mk3008 opened this issue 8 months ago • 0 comments

We would like to be able to omit the table join if the join expression is defined in the model class.

Currently, this kind of writing is necessary.

var query = Sql.From(() => od)
                .InnerJoin(() => o, () => o.order_id == od.order_id)

If the join expression is defined in the model class, it should be possible to write it as shown below.

var query = Sql.From(() => od)
                .InnerJoin(() => o)

Note that if there are multiple table joins (for example, creator and updater), this method cannot be used and a runtime error will occur.

Also, if you do not want to use the join expression defined in the model class, you should be able to avoid this by defining it manually. (Previous specifications)

mk3008 avatar May 30 '24 22:05 mk3008