Skip to content

docs: clarify sqlx.In always uses ? placeholders#995

Open
Solaris-star wants to merge 1 commit into
jmoiron:masterfrom
Solaris-star:docs/959-in-placeholder
Open

docs: clarify sqlx.In always uses ? placeholders#995
Solaris-star wants to merge 1 commit into
jmoiron:masterfrom
Solaris-star:docs/959-in-placeholder

Conversation

@Solaris-star

Copy link
Copy Markdown

Description

sqlx.In always expects ? placeholders. PostgreSQL users often write $1 in the query passed to In, which does not expand and commonly fails with:

number of bindVars less than number arguments

Fix

  • Expand godoc on In with the correct InRebind pattern
  • Add a short README note under install

Tests

Docs-only. Package compiles.

Linked Issue

Closes #959

Postgres users often write $1 in the query passed to In, which does not
expand and surfaces as "number of bindVars less than number arguments".

Document that In expects ?, then Rebind for the driver.

Fixes jmoiron#959
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.

(Documentation) sqlx.In should be used with (?) instead of ($1) for postgres

1 participant