Function: snapshotAsOf()
このコンテンツはまだ日本語訳がありません。
Function: snapshotAsOf()
Section titled “Function: snapshotAsOf()”snapshotAsOf<
S>(options):Promise<Map<string,Map<string,Record<string,unknown>>>>
Defined in: server/src/time-travel.ts:19
Rebuild the state of a table at the moment cookie was current, by
replaying every change_log entry with row_version <= cookie. Rows that
were deleted before the cookie are absent; rows updated after the cookie
reflect their earlier value.
Useful for audit dashboards, “compare with a week ago” UIs, and compliance replays. Cost is O(number of change log entries) — for production use with millions of writes you’d want a compaction job (v2-13) or a materialised snapshot table.
Type Parameters
Section titled “Type Parameters”S extends Record<string, AnyTable>
Parameters
Section titled “Parameters”options
Section titled “options”schema
Section titled “schema”S
executor
Section titled “executor”cookie
Section titled “cookie”string | number
dialect?
Section titled “dialect?”Returns
Section titled “Returns”Promise<Map<string, Map<string, Record<string, unknown>>>>