MCPcopy Index your code
hub / github.com/simstudioai/sim / timeCursorPredicate

Function timeCursorPredicate

apps/sim/lib/data-drains/sources/cursor.ts:41–48  ·  view source on GitHub ↗
(
  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 */
41export 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

Callers 5

pagesFunction · 0.90
pagesFunction · 0.90
pagesFunction · 0.90
pagesFunction · 0.90
pagesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected