Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve support for sqlite named parameters #2259

Closed
wants to merge 2 commits into from

Conversation

orisano
Copy link
Contributor

@orisano orisano commented May 4, 2023

sqlite supports the named parameter, but currently sqlc does not rewrite it as it does in postgresql.
Because named.IsParamSign judges whether named parameter is named or not by the content of ast.A_Expr, but sqlite3 converts from BindContext to ast.ParamRef and loses the name information.
In sqlite3, it is modified to return ast.A_Expr or ast.ParamRef depending on the contents of BindContext when converting.

And, parameter functions do not work in sqlite.
This is because names containing a dot, such as sqlc.arg, cause a syntax error.
So functions starting with sqlc_ are interpreted as starting with sqlc. in sqlite.

related:

@kyleconroy
Copy link
Collaborator

Closed via #2274

@kyleconroy kyleconroy closed this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants