Skip to content

Commit c4cfcf1

Browse files
committed
update pagination docs
1 parent ba7956f commit c4cfcf1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/official-site/sqlpage/migrations/70_pagination.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ with recursive pages as (
2828
select
2929
(offset/100+1) as contents,
3030
sqlpage.link(sqlpage.path(), json_object(''offset'', offset)) as link,
31-
(offset/100+1 = $offset) as active from pages;
31+
offset = coalesce(cast($offset as integer), 0) as active
32+
from pages;
3233
```
3334
3435
For more advanced usage, the [pagination guide](blog.sql?post=How+to+use+the+pagination+component) provides a complete tutorial.

0 commit comments

Comments
 (0)