Skip to main content

CursorExpressions

还没翻译译自英文(tanstack.com)本页 14 段都还没译

type CursorExpressions = object;

Defined in: packages/db/src/types.ts:298

Cursor expressions for pagination, passed separately from the main where clause. The sync layer can choose to use cursor-based pagination (combining these with the where) or offset-based pagination (ignoring these and using the offset parameter).

Neither expression includes the main where clause - they are cursor-specific only.

Properties

lastKey?

optional lastKey: string | number;

Defined in: packages/db/src/types.ts:316

The key of the last item that was loaded. Can be used by sync layers for tracking or deduplication.


whereCurrent

whereCurrent: BasicExpression<boolean>;

Defined in: packages/db/src/types.ts:311

Expression for rows equal to the current cursor value (first orderBy column only). Used to handle tie-breaking/duplicates at the boundary. Example: eq(col1, v1) or for Dates: and(gte(col1, v1), lt(col1, v1+1ms))


whereFrom

whereFrom: BasicExpression<boolean>;

Defined in: packages/db/src/types.ts:305

Expression for rows greater than (after) the cursor value. Core emits this predicate from the leading order column. Multi-column queries load the complete leading-value tie separately instead of constructing a composite cursor.