-
Notifications
You must be signed in to change notification settings - Fork 377
Closed
Labels
in: selectbuilderSelectBuilder stands for the complete API for creating SQL statements programmatically.SelectBuilder stands for the complete API for creating SQL statements programmatically.type: enhancementA general enhancementA general enhancement
Milestone
Description
Hi,
Follow up on #995 with a separate issue. Attempting to use Expressions.just to work around #995, I learned that SelectBuilder ignores Expressions.just and "silently" generates invalid SQL. Consider the following code:
Table transport = Table.create("transport");
Table transportCall = Table.create("transport_call");
Select finalSelect = Select.builder().select(transportCall.asterisk())
.from(transportCall)
.join(transport).on(Expressions.just("bar")).equals(Expressions.just("foo"))
.build();This generates the following invalid SQL:
SELECT transport_call.*
FROM transport_call
JOIN transport ON
Notice how everything after ON-clause is omitted. (If you add a .where(...) then you will end up with JOIN transport ON WHERE ...)
Metadata
Metadata
Assignees
Labels
in: selectbuilderSelectBuilder stands for the complete API for creating SQL statements programmatically.SelectBuilder stands for the complete API for creating SQL statements programmatically.type: enhancementA general enhancementA general enhancement