Help · section 34 of 44
Time Travel (temporal history)
Mirrors the in-app Help. The live copy in your console and `dlake guide help` are always current.
SQL Server system-versioned temporal tables: enable Time Travel per table (Schema Builder → the table’s Time Travel toggle) and the engine records every row version into a <table>_History side table automatically — query the past without pre-planned snapshots. Mutually exclusive with Concurrency Protection (a versioned table can’t carry CP’s INSTEAD OF DELETE trigger). Not mutually exclusive with event capture — the two coexist, and enabling Time Travel installs no trigger, so it needs no DAB restart. (Event capture does need one; see Triggers and the Data API.) Requires data.read to read; the read paths are RLS-scoped over history exactly like a live read (the base-table security predicate is mirrored onto the history table) and honor a scope-restricted key’s per-entity read grant. An All-fields scoped key’s temporal reads run under its database principal (DB-enforced, incl. history-table SELECT); a field-restricted key is refused (403) on the temporal endpoints (they return whole rows). When RLS applies to the table, temporal reads fail closed: the read is refused with an error asking you to retry rather than ever returning unfiltered history. Timestamps are ISO-8601 UTC (marker-less values assumed universal, e.g. 2026-07-01T00:00:00Z).
REST under /api/ddl/temporal/tables/{table}/…; over MCP four read-only tools (use the tenant’s active schema table name — call get_active_schema if unsure):
temporal_status{table}(/status) — is versioning on, plus period columns / primary key / history-table name /state(on|dormant|off). Call first to confirm a table is versioned.query_as_of{table, asOf, page?, pageSize?}(/as-of) — the table’s rows as they existed atasOf(paged; page 1 / pageSize 50 by default).row_history{table, key}(/row-history) — the full version timeline of one row, keyed by primary key (keyis a column→value object, e.g.{"Id": 42}; supply every column of a composite PK); each version carries itsdl_sys_start/dl_sys_endUTC validity window.time_travel_diff{table, from, to, page?, pageSize?}(/diff) — rows added / removed / changed between two instants, with before/after values for changed columns (joined on the primary key).
Example: temporal_status {"table":"account"} → then query_as_of {"table":"account","asOf":"2026-07-01T00:00:00Z"} or time_travel_diff {"table":"account","from":"2026-06-01T00:00:00Z","to":"2026-07-01T00:00:00Z"}.