Remote / foldkit-remote-drizzle

rowChangeLog

function · packages/remote-drizzle/src/poll.ts:403

function rowChangeLog(
  binding: AnyEntityBinding,
  options?: {
    readonly keep?: number | undefined
  },
): ReadonlyArray<string>

The SQLite statements (D1's dialect) that keep a log of the rows each write to binding's table touched, in order, for rowLog to read: a table, and triggers on insert, update and delete, so every path that writes the table (a declared write, a handler, raw SQL) is logged with no code of its own. The last keep entries are kept (default 1000); a stream further behind reads everything. One statement each, for a migration that runs them one at a time. A Postgres table is refused: it has LISTEN for this, and a server there can push.