Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test for mixed param case
  • Loading branch information
andriygm committed May 15, 2025
commit 1c9ee2ec91396c442b5aa92b1a565b887ec1be83
3 changes: 0 additions & 3 deletions internal/endtoend/testdata/order_by_binds/sqlite/exec.json

This file was deleted.

2 changes: 1 addition & 1 deletion internal/endtoend/testdata/order_by_binds/sqlite/go/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 41 additions & 1 deletion internal/endtoend/testdata/order_by_binds/sqlite/go/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions internal/endtoend/testdata/order_by_binds/sqlite/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ SELECT * FROM authors
WHERE id > sqlc.arg(min_id)
ORDER BY CASE WHEN sqlc.arg(sort_column) = 'name' THEN name END;

-- name: ListAuthorsColumnSortDirection :many
SELECT * FROM authors
WHERE id > ?
ORDER BY
CASE
WHEN @order_by = 'asc' THEN name
END ASC,
CASE
WHEN @order_by = 'desc' OR @order_by IS NULL THEN name
END DESC;

-- name: ListAuthorsColumnSortFnWtihArg :many
SELECT * FROM authors
ORDER BY id % ?;
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/order_by_binds/sqlite/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"path": "go",
"engine": "sqlite",
"name": "querytest",
"name": "order_by_binds",
"schema": "schema.sql",
"queries": "query.sql"
}
Expand Down
Loading