SELECT foo.id, foo.some_field AS someField, bar.foo_id AS fooId, bar.other_field AS otherField
FROM foo foo
INNER JOIN bar bar ON bar.foo_id = foo.id
WHERE foo.some_field = 'baz'
AND bar.other_field = 'boo'
Actual behavior
Instead of foo.some_field = 'baz' the first term in the where clause is bar.some_field = 'baz', i.e. the generated sql is
SELECT foo.id, foo.some_field AS someField, bar.foo_id AS fooId, bar.other_field AS otherField
FROM foo foo
INNER JOIN bar bar ON bar.foo_id = foo.id
WHERE bar.some_field = 'baz'
AND bar.other_field = 'boo'
Version: I've tried
4.0.0
-4.6.0
Module:protoquill
Database: I've triedpostgres
andh2
Expected behavior
Given
I expect
to generate
Actual behavior
Instead of
foo.some_field = 'baz'
the first term in the where clause isbar.some_field = 'baz'
, i.e. the generated sql isSteps to reproduce the behavior
See https://scastie.scala-lang.org/zYJwK8KoSH2hxV0tmTHLLQ as an example.
Workaround
Rewrite as
@getquill/maintainers