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
When the BETWEEN is preceeded by a WHERE, then the generation works as expected.
Adding the BETWEEN after an AND makes the generator completely ignore the parameters/placeholders used in that BETWEEN ? AND ?.
Execute make generate in order to trigger the generation again.
Relevant log output
Database schema
CREATETABLEIF NOT EXISTS test (
id INTEGERPRIMARY KEY,
name TEXTNOT NULL
);
SQL queries
-- name: QueryBetweenBroken :manySELECT id FROM test
WHERE name = ?
AND id BETWEEN ? AND ?;
-- name: QueryBetweenNamedBroken :manySELECT id FROM test
WHERE name = :name
AND id BETWEEN :min AND :max;
-- name: QueryBetweenWorking :manySELECT id FROM test
WHERE id BETWEEN ? AND ?
AND name = ?;
-- name: QueryBetweenNamedWorking :manySELECT id FROM test
WHERE id BETWEEN :min AND :max
AND name = :name;
Version
1.29.0
What happened?
When the
BETWEEN
is preceeded by aWHERE
, then the generation works as expected.Adding the
BETWEEN
after anAND
makes the generator completely ignore the parameters/placeholders used in thatBETWEEN ? AND ?
.The bug is reproduced in this small repository:
https://github.com/jxsl13/sqlc-sqlite-between-test
Execute
make generate
in order to trigger the generation again.Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/da0d89a7020cd56af50a28351fab6b34e584de4a03410f72c704eb687b323ee8
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: