Skip to content

Commit

Permalink
add some docs explaining ErrTooMany
Browse files Browse the repository at this point in the history
  • Loading branch information
guregu committed Dec 17, 2024
1 parent 9fd42c9 commit c3fe79b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ func (q *Query) ConsumedCapacity(cc *ConsumedCapacity) *Query {

// One executes this query and retrieves a single result,
// unmarshaling the result to out.
// This uses the DynamoDB GetItem API when possible, otherwise Query.
// If the query returns more than one result, [ErrTooMany] may be returned. This is intended as a diagnostic for query mistakes.
// To avoid [ErrTooMany], set the [Query.Limit] to 1.
func (q *Query) One(ctx context.Context, out interface{}) error {
if q.err != nil {
return q.err
Expand Down

0 comments on commit c3fe79b

Please sign in to comment.