-
Notifications
You must be signed in to change notification settings - Fork 930
-
Hi, All!
Is there a solution to paginate :many context?
Thanx a lot!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
In my reading of the docs, you would do:
-- name: GetThings :many SELECT * FROM things WHERE field = $1 ORDER BY created_at desc LIMIT $2 OFFSET $3;
The generated function looks like this:
type GetThingsParams struct { Field string Limit int32 Offset int32 } type GetThingsRow struct { ID int32 Field string ... } func (q *Queries) GetThings(ctx context.Context, arg GetThingsParams) ([]GetThingRow, error) { ... }
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment