sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Add query annotation similar to `:one` that verifies only a single row matches

Open prashantv opened this issue 2 months ago • 0 comments

What do you want to change?

A query may be expected to only match a single row, but due to bugs, ends up accidentally matching multiple rows. Rather than selecting the first row, it can be useful to detect and fail-fast in this scenario.

A new annotation like :only-one that ensures there's only one result can help detect bugs in the query or use early.

What database engines need to be changed?

No response

What programming language backends need to be changed?

No response

prashantv avatar Oct 13 '25 21:10 prashantv