Open aimuz opened 5 months ago
Which database engine are you using?
Having the URL to the playground would help expedite the investigation of the issue. https://play.sqlc.dev/
https://play.sqlc.dev/p/5e94361639a0479b5ddc3624921392f5e6a36e9bc461ff7b7abb030ea339a12d
Sorry for not adding enough information, I shared a url
Theoretically, you should be able to do the following:
-- name: ListTemplates :many
SELECT *
FROM templates
WHERE (sqlc.arg(in_user_id)::bool != TRUE OR user_id IN (sqlc.slice(user_ids)))
AND (sqlc.arg(gt_updated_at)::bool != TRUE OR updated_at > ?)
ORDER BY updated_at, id
LIMIT ?,?;
With this, the generated data would be as expected, according to the documentation, but it ends up generating the following error:
sqlc generate failed.
# package
query.sql:4:29: syntax error near "::bool != TRUE OR user_id IN (sqlc.slice(user_ids)))"
Only postgresql supports this syntax.
Version
1.26.0
What happened?
This is the parameter that generates the
I expect to generate the following structure
Relevant log output
No response
Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
No response
What operating system are you using?
No response
What database engines are you using?
No response
What type of code are you generating?
No response