toKeysetOrderBySql
function toKeysetOrderBySql(order, columns): string;Defined in: keyset.ts:384
Render KeysetSpec.orderBy output as an SQL ORDER BY fragment.
The returned string does not include the leading ORDER BY. Column
identifiers/expressions are resolved from columns. Plain strings are
validated with assertSqlIdentifier; computed expressions must be
explicitly wrapped with keysetSqlExpression. No request data should
ever be used for column mappings.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
order |
KeysetSortKey[] |
columns |
KeysetSqlColumns |
Returns
Section titled “Returns”string
Example
Section titled “Example”toKeysetOrderBySql(keyset.orderBy("backward"), { createdAt: "created_at", id: "id",});// "created_at DESC, id DESC"Throws
Section titled “Throws”If a key is missing from columns or a column identifier is unsafe.