Skip to content

docs: clarify sqlx.In always uses ? placeholders - #1003

Open
TastyHeadphones wants to merge 1 commit into
jmoiron:masterfrom
TastyHeadphones:docs/959-in-placeholders
Open

TastyHeadphones wants to merge 1 commit into
jmoiron:masterfrom
TastyHeadphones:docs/959-in-placeholders

Conversation

@TastyHeadphones

Copy link
Copy Markdown

People on Postgres often write IN ($1) with sqlx.In and get bindVar count errors. In only expands ?, so you write IN (?) and then db.Rebind for the driver.

Clarified that in the In godoc and added a short note in the README.

Fixes #959

People on Postgres often try IN ($1) with In and hit bindVar count
errors. Spell out that In only understands ?, then Rebind for the driver.

Fixes jmoiron#959

This branch has not been deployed

No deployments
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