Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

@kyleconroy kyleconroy commented Feb 24, 2023

It appears the v4 does not support ? placeholders anymore. The following query fails with a parse error:

SELECT * FROM users WHERE id = ?;

Update: These queries would never have worked in the first place, as the PostgreSQL server does not support the ? syntax. Going to go ahead and merge this :)

@kyleconroy kyleconroy changed the title Upgrade package, many build errors engine/postgres: Upgrade to pg_query_go/v4 Feb 24, 2023
@kyleconroy kyleconroy marked this pull request as ready for review February 25, 2023 00:03
@kyleconroy kyleconroy merged commit a71c584 into main Feb 27, 2023
@kyleconroy kyleconroy deleted the kyle/upgrade-pg-query-go branch February 27, 2023 18:36
@oliverpool
Copy link
Contributor

I have been using the postgres engine and then running my code on sqlite (since the sqlite engine is missing a few features).
So I just got bitten by this change (but since my workflow is hacky, this is not a real surprise).

Replacing all ? is not so tedious and thanks to compile time type checking, I am pretty confident of update 👍

alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
* Add support for pg.Boolean
* Return ast.Null
* Fix cast stmt bool
* Add support for FunctionParameterMode_FUNC_PARAM_DEFAULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants