-
Notifications
You must be signed in to change notification settings - Fork 912
Closed
Labels
Description
What do you want to change?
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).
See:
jackc/pgx#1411 (comment)
#3956
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?
Go
pracj3am