You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pgx now supports CollectExactlyOneRow. This returns error when there is more than 1 resulting row, but doesn't fetch them all.
This could be done by either modifying :one behaviour, or adding :exactlyone annotation.
I think adding :exactlyone annotation is better, because erroring on :one on select where sqlc currently doesn't error is backwards incompatible change, and it doesn't strike me as correct anyway (:one can mean I actually want the first from many, see the pgx thread).
If this is desired, I can take a shot at this feature and try to add it myself since it doesn't strike me as that hard (and, sqlc already has annotations that are just for go and just for pgx), but, let's see :)
What database engines need to be changed?
PostgreSQL
What programming language backends need to be changed?
Activity
timmcca-be commentedon Apr 8, 2026
@ kyleconroy I see you closed this as completed. Can you clarify where this was implemented and how to use it? I don't see it in the code or the docs.
EDIT: I see that this was actually closed in order for conversation to continue in #3956