⏱️ Temporal Queries

Every row carries four timestamps: valid_from, valid_to (when the fact was true in the real world) and system_from, system_to (when RelataDB knew it).

AS OF — point-in-time queries

# Valid time: what was true on Jan 20?
client.query("SELECT COUNT(*) FROM Person AS OF '2026-01-20T00:00:00Z'")
 
# System time: what did we KNOW on Jan 20?
client.query("SELECT COUNT(*) FROM Person AS OF SYSTEM TIME '2026-01-20T00:00:00Z'")

WITH PROVENANCE — every row carries its chain

result = client.query("SELECT name, company FROM Person WITH PROVENANCE")
# Each row includes prov_hex, source, commit_hash, timestamp.

Bi-temporal via the fluent builder

result = (
    client.select("Person")
         .where("risk = 'HIGH'")
         .as_of("2026-01-20")
         .with_provenance()
         .limit(20)
         .execute()
)

Next: Read the full end-to-end story — 📖 Operation Shadow Ledger — or jump to 🛡️ Operation Nightwatch (Cyber SOC) for the focused EDR threat-hunting variant.