Skip to main content

Local DB Instances

The local-db-instances.ts module is the “Temporal Auditor” — it manages the lifecycle of individual task occurrences within the local SQLite cache.

Orphan Survival

The schema has zero foreign key constraints. Instances are first-class citizens that can exist with or without a parent task. When updating an orphaned instance, the module falls back to the raw Convex task_id:

Core Operations


Atomic Clobber and Spawn

Updates use a “delete then insert” strategy within a transaction. This guarantees that even if the column set changes between versions, the row is always fresh and complete.