(timestampCol: PgColumn, idCol: PgColumn)
| 52 | * millisecond bucketing so cursor advancement never skips rows. |
| 53 | */ |
| 54 | export function timeCursorOrderBy(timestampCol: PgColumn, idCol: PgColumn): [SQL, SQL] { |
| 55 | return [sql`date_trunc('milliseconds', ${timestampCol}) asc`, sql`${idCol} asc`] |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Excludes rows newer than a short stability window. Timestamp cursors assume |