Open
Description
Version
1.28.0
What happened?
The sqlc.arg
or @
is not working for LIMIT
and OFFSET
.
Relevant log output
sqlc generate failed.
# package
query.sql:23:9: syntax error at or near "limit"
Database schema
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
SQL queries
-- name: PaginatedShorthand :many
select * from authors
limit @limit offset @offset;
-- name: Paginated :many
select * from authors
limit sqlc.arg(limit) offset sqlc.arg(offset);
Configuration
{
"version": "2",
"sql": [{
"schema": "schema.sql",
"queries": "query.sql",
"engine": "postgresql",
"gen": {
"go": {
"out": "db"
}
}
}]
}
Playground URL
https://play.sqlc.dev/p/eced169bc45bd4aabe057c4913eaaf2c405c594271ff574dfbdff6b632527970
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go