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
wil be very useful to add pagination on select query.
this avoid the need to be implemented with args.
with defined request like in example:
-- name: ListAuthors :many
SELECT * FROM authors
ORDER BY name;
To be abel to use like this:
// list all authors pagintated with page size of 10// behind the scene use count from select and divide by the size// and at each page use limit and offset to get the selected pagepagedAuthors, err:=queries.ListPaginatedAuthors(ctx,10)
iferr!=nil {
returnerr
}
// to loop pagespageMax:=pagedAuthors.GetMaxPages()
pagedAuthors.Reset()
forpagenumber:=0; pagenumber<pageMax; pagenumber++ {
authors:=pagedAuthors.Next()
log.Println(pagenumber)
log.Println(authors)
}
// or the get specific page (the 2s page)authors:=pagedAuthors.Get(2)
log.Println(authors)
What database engines need to be changed?
any supported
What programming language backends need to be changed?
any language supported (my sample is in go)
The text was updated successfully, but these errors were encountered:
mcarbonneaux
changed the title
[feature request] adding integreted pagination support in select query
[feature request] adding integrated pagination support in select query
Feb 28, 2025
What do you want to change?
wil be very useful to add pagination on select query.
this avoid the need to be implemented with args.
with defined request like in example:
To be abel to use like this:
What database engines need to be changed?
any supported
What programming language backends need to be changed?
any language supported (my sample is in go)
The text was updated successfully, but these errors were encountered: