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

StrictNamedArgs #1941

Merged
merged 1 commit into from Mar 16, 2024
Merged

StrictNamedArgs #1941

merged 1 commit into from Mar 16, 2024

Conversation

Fazt01
Copy link
Contributor

@Fazt01 Fazt01 commented Mar 13, 2024

A new type very similar to pgx.NamedArgs, but to protect against typos and/or forgotten arguments, arguments are checked that all are used in query and no extra arguments are provided.

Considering the parsing is in unexported types/functions, this cannot be easily implemented outside of pgx without copying most of the NamedArgs SQL parsing logic.

The original logic is extracted to rewriteQuery with isStrict flag to decide whether to do the original flow of NamedArgs or do the extra checks.

@jackc jackc merged commit b6e5548 into jackc:master Mar 16, 2024
5 of 14 checks passed
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.

None yet

2 participants