Function
timeCursorPredicate
(
timestampCol: PgColumn,
idCol: PgColumn,
cursor: TimeCursor | null
)
Source from the content-addressed store, hash-verified
| 39 | * lexicographically earlier id than the cursor row would be skipped forever. |
| 40 | */ |
| 41 | export function timeCursorPredicate( |
| 42 | timestampCol: PgColumn, |
| 43 | idCol: PgColumn, |
| 44 | cursor: TimeCursor | null |
| 45 | ): SQL | undefined { |
| 46 | if (!cursor) return undefined |
| 47 | return sql`(date_trunc('milliseconds', ${timestampCol}), ${idCol}) > (${new Date(cursor.ts)}, ${cursor.id})` |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * ORDER BY fragments paired with `timeCursorPredicate`. Both must agree on |
Tested by
no test coverage detected