The generated code is not what I expected.
Originally, the part specified by sqlc.arg() was ? but it is output as it is.
Expected Result
const listTests = `-- name: ListTests :many
SELECT id, created_at FROM tests
WHERE created_at >= ?
AND NOT (created_at = ? AND id <= ?)
ORDER BY created_at ASC
LIMIT ?
`
type ListTestsParams struct {
ID []byte
CreatedAt time.Time
Limit int32
}
Actual Result
const listTests = `-- name: ListTests :many
SELECT id, created_at FROM tests
WHERE created_at >= ?
AND NOT (created_at = sqlc.arg(created_at) AND id <= sqlc.arg(id))
ORDER BY created_at ASC
LIMIT ?
`
type ListTestsParams struct {
CreatedAt time.Time
Limit int32
}
-- name: ListTests :many
SELECT * FROM tests
WHERE created_at >= sqlc.arg(created_at)
AND NOT (created_at = sqlc.arg(created_at) AND id <= sqlc.arg(id))
ORDER BY created_at ASC
LIMIT ?;
Version
1.27.0
What happened?
The generated code is not what I expected. Originally, the part specified by
sqlc.arg()
was?
but it is output as it is.Expected Result
Actual Result
Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go