sqlvet
sqlvet copied to clipboard
Queries with question mark placeholders (?) not valid anymore
Queries with (?) are not valid since updated version from 1.1.6 to 1.1.7/1.1.8, doesn't depend on go version
SELECT id FROM my_table WHERE id IN (?);
Getting ERROR: syntax error at or near ")"
Another example:
SELECT * FROM my_table WHERE id = ? AND user_id IN (?);
Getting ERROR: syntax error at or near "AND"
relates to https://github.com/pganalyze/pg_query_go/issues/78
This change is intentional - that was always a libpg_query patch, Postgres never supported this syntax for parameter references. Though some ORMs support ? replacement characters, they then do local substitution and don't send the query in that form to the Postgres server.
@houqp not sure if need to fix this