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
Similarly to #3113
The postgres generator supports variables in the ORDER BY, but sqlite does not.
CREATETABLEauthors (
id intPRIMARY KEY
);
-- name: GetAuthor :oneSELECT*FROM authors
WHERE id = @id
ORDER BY @order_by;
const getAuthor = `-- name: GetAuthor :one
SELECT id FROM authors
WHERE id = ?1
ORDER BY @order_by
`
func (q *Queries) GetAuthor(ctx context.Context, id int64) (int64, error) {
row := q.db.QueryRowContext(ctx, getAuthor, id)
err := row.Scan(&id)
return id, err
}
Playground link is to 1.25.0, but this is happening locally on 1.27.0 as well. Changing only the engine value to postgresql results in the expected output for postgresql. But the same is not reflected in sqlite.
Relevant log output
Database schema
CREATETABLEauthors (
id intPRIMARY KEY
);
SQL queries
-- name: GetAuthor :oneSELECT*FROM authors
WHERE id = @id
ORDER BY @order_by;
Version
1.27.0
What happened?
Similarly to #3113
The postgres generator supports variables in the ORDER BY, but sqlite does not.
Playground link is to 1.25.0, but this is happening locally on 1.27.0 as well. Changing only the engine value to
postgresql
results in the expected output for postgresql. But the same is not reflected in sqlite.Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/a0947e011d5ec187db7c502d1044c9eb10d6a2f9f5c6d44f166b23a2fa6c5f07
What operating system are you using?
macOS
What database engines are you using?
SQLite
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: