Skip to content

Commit bfa28f5

Browse files
committed
Improve the keyset docs
1 parent 83f877c commit bfa28f5

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

docs/api/keyset.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ less convenient for UIs.
4141
| `uniquely ordered` | When the concatenation of the values of the ordered columns is unique for each record. It is similar to a composite primary `key` for the ordered table, but dynamically based on the `keyset` columns. |
4242
| `set` | The `uniquely ordered` `ActiveRecord::Relation` or `Sequel::Dataset` collection to paginate. |
4343
| `keyset` | The hash of column/direction pairs. Pagy extracts it from the order of the `set`. |
44-
| `latest` | The hash of `keyset` attributes of the `latest` fetched record (from the latest page). Pagy decodes it from the `:page` variable, and uses it to filter out the records already fetched. |
44+
| `latest` | The hash of `keyset` attributes of the `latest` fetched record (from the latest page). Pagy decodes it from the `:page` variable and uses it to filter out the records already fetched. |
4545
| `next` | The next `page`, i.e. the encoded reference to the last record of the **current page**. |
4646
| `page` | The current `page`, i.e. the encoded reference to the `latest` record of the **latest page**. |
4747

@@ -162,10 +162,9 @@ automatically assigned from the `limit` request param.
162162

163163
=== `:tuple_comparison`
164164

165-
Boolean variable that enables the tuple comparison e.g. `(brand, id) > (:brand, :id)`. It works only for same direction order,
166-
hence it's ignored for mixed order. Check how your DB supports it (your `keyset` should include only `NOT NULL` columns).
167-
Default
168-
`nil`.
165+
Boolean variable that enables the tuple comparison e.g. `(brand, id) > (:brand, :id)`. It works only with the same direction
166+
order, hence it's ignored for mixed order. Check how your DB supports it (your `keyset` should include only `NOT NULL` columns).
167+
Default `nil`.
169168

170169
==- `:after_latest`
171170

@@ -242,7 +241,7 @@ They may have been stored as strings formatted differently than the default form
242241
- Ensure that the composite index reflects exactly the columns sequence and order of your keyset
243242
- Research about your specific DB features, type of index and performance for different ordering. Use SQL `EXPLAIN ANALYZE`
244243
or similar tool to confirm.
245-
- Consider using the same direction order, enabling the `:tuple_comparison`, changing type of index (different DBs may behave
244+
- Consider using the same direction order, enabling the `:tuple_comparison`, and changing type of index (different DBs may behave
246245
differently)
247246
- Consider using your custom optimized `when` query with the [:after_latest](#after-latest) variable
248247
!!!

docs/extras/keyset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ categories:
77

88
# Keyset Extra
99

10-
Paginate with the Pagy keyset pagination technique.
10+
Paginate with the Pagy keyset pagination technique.
1111

12-
[!button corners="pill" variant="success" text=":icon-play: Try it now!"](/playground.md#3-demo-app)
12+
[!button corners="pill" variant="success" text=":icon-play: Try it now!"](/playground.md#5-keyset-apps)
1313

1414
## Overview
1515

0 commit comments

Comments
 (0)