You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello All,
Quick question. Not sure if this is exactly sqlc thing or something beyond. Migrating a go code from using sql boiler ( where query is constructed on the fly that does a join optionally based on argument not being null ) to sqlc.
Basically a query where the join is conditional upon an argument passed being not-null.
I have a dumb down sample query to test out conditional join in sqlc, but it errors out. What to know if this is supported.
Thank you for your help.
Query:
-- name: TestJoin :many
SELECT * FROM authors
CASE
WHEN 1=1 THEN INNER JOIN addr ON name = addr.name
END
;
sqlc error:
sqlc generate failed.
# package
query.sql:3:2: syntax error at or near "CASE"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello All,
Quick question. Not sure if this is exactly sqlc thing or something beyond. Migrating a go code from using sql boiler ( where query is constructed on the fly that does a join optionally based on argument not being null ) to sqlc.
Basically a query where the join is conditional upon an argument passed being not-null.
I have a dumb down sample query to test out conditional join in sqlc, but it errors out. What to know if this is supported.
Thank you for your help.
Query:
sqlc error:
Beta Was this translation helpful? Give feedback.
All reactions