-
Notifications
You must be signed in to change notification settings - Fork 0
Pagination
Christoph Herrmann edited this page Oct 17, 2019
·
3 revisions
Because of pagination is a common use case there is also a pagination shorthand:
const page = 5
const pageSize = 15
const result = await sql.query(sql`
SELECT * FROM users ${sql.pagination(page, { pageSize })}
`)
// text: SELECT * FROM users LIMIT 15 OFFSET 75
// values: []
The default pageSize 10
can be changed by setting sql.defaultPageSize
.
Found a bug or missing a feature? -> Create a new Issue
Found a security issue? -> Look at the Security Policy
Having questions, want to give feedback or talk to me? -> E-Mail me [email protected]