sqlboiler icon indicating copy to clipboard operation
sqlboiler copied to clipboard

Eager loading user table results in an sql error if the user table has a delete_at field

Open nigeltiany opened this issue 2 years ago • 0 comments

What version of SQLBoiler are you using (sqlboiler --version)?

v4.14.2

What is your database and version (eg. Postgresql 10)

Postgres 15

If this happened at runtime what code produced the issue? (if not applicable leave blank)

Eager loading user table results in an sql error if the user table has a delete_at field

Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)

a table named user with a deleted_at field and a query that eager loads the users table through a pivot table

Further information. What did you do, what did you expect?

https://github.com/volatiletech/sqlboiler/issues/583

debug log output: SELECT * FROM "user" WHERE ("user"."id" IN ($1)) AND (user.deleted_at is null); error: failed to eager load User: failed to eager load User: pq: syntax error at or near "."

expected log output: SELECT * FROM "user" WHERE ("user"."id" IN ($1)) AND ("user"."deleted_at" is null);

nigeltiany avatar Sep 20 '23 23:09 nigeltiany