Fix Postgres placeholder rewrite to preserve sqlc numbered placeholders - #18
Open
DeveloperDurp wants to merge 1 commit into
Open
Fix Postgres placeholder rewrite to preserve sqlc numbered placeholders#18DeveloperDurp wants to merge 1 commit into
DeveloperDurp wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
?1->$11) causing prepared statements to refer to non-existent parameters and producing runtime query errors.Description
internal/pgdriver/rewrite.goso the placeholder rewriter consumes digits after?and preserves numbered placeholders (e.g.?1->$1) while still renumbering anonymous?placeholders to$1, $2, ....?occurrences inside single- or double-quoted strings remain untouched.internal/pgdriver/rewrite_test.gocovering repeated numbered placeholders, mixed numbered/anonymous placeholders, and numbered placeholders inside string literals.Testing
go test -count=1 ./internal/pgdriverand the package tests passed successfully.gofmtchecks andgit diff --checkto ensure formatting and basic checks passed with no reported issues.go test -count=1 ./..., which exercised many packages successfully but failed to complete because generated templ files andstatic/swagger-uiassets required by the top-level build/tests were not present in this checkout; this is a known repository precondition and unrelated to the placeholder fix.Codex Task