Placeholder issue/design discussion for Scan & Query pagination support
Paginated queries/scans will take an ?exclusiveStartKey : TableKey parameter and return a PaginationResult<'TRecord> defined as { Records : 'TRecord[]; LastEvaluatedKey : TableKey option }
(Tentatively) these will be added as new methods QueryPaginated etc, although I’m tempted to convert the existing methods to return paginated results as the default and add QueryAll to perform unbounded queries, even though this is a breaking change.
New convenience accessors on the PaginationResult - eg member x.GetLastEvaluatedHashKey<'HashKey>() : 'HashKey option to enable serialisation of key values for client-side pagination. For a query this will typically only be the range key as the hash key should already be known. For a scan two key values may be required.
Unfortunately I’ve just discovered GSI queries also require the table key attributes in addition to the index. I’ll be able to get this to work if the returned LastEvaluatedKey is used as an opaque parameter for the next query, but manually constructing an ExclusiveStartKey from client requests is going to be painful.
@samritchie Is there any work going on regarding this? If you have a work in progress branch somewhere I could take a look at it and possibly continue with it.
Placeholder issue/design discussion for Scan & Query pagination support
?exclusiveStartKey : TableKey
parameter and return aPaginationResult<'TRecord>
defined as{ Records : 'TRecord[]; LastEvaluatedKey : TableKey option }
QueryPaginated
etc, although I’m tempted to convert the existing methods to return paginated results as the default and addQueryAll
to perform unbounded queries, even though this is a breaking change.PaginationResult
- egmember x.GetLastEvaluatedHashKey<'HashKey>() : 'HashKey option
to enable serialisation of key values for client-side pagination. For a query this will typically only be the range key as the hash key should already be known. For a scan two key values may be required.Unfortunately I’ve just discovered GSI queries also require the table key attributes in addition to the index. I’ll be able to get this to work if the returned
LastEvaluatedKey
is used as an opaque parameter for the next query, but manually constructing anExclusiveStartKey
from client requests is going to be painful.