SQLite schema reference
Every table the client SDK keeps in each device's encrypted SQLite database.
70 tables, as of local schema step add_local_sync_notices. docs/database/sqlite.json
The tables the client SDK keeps in each identity's local SQLite database, defined with Drizzle in packages/client-sdk/src/data/sqlite/schema. The SDK creates a table the first time a feature needs it, and local schema migrations move an existing database forward before that. The DDL on each table's page is exactly what the client runs.
The whole database file is encrypted at rest with SQLite3MultipleCiphers under a key from the local keyring, and on the web it lives in the browser's origin private file system. Host apps add their own projection tables beside these: the Tearleads app adds contact_projection.
Container
packages/client-sdk/src/data/sqlite/schema/containerSchema.ts
container_Latest removal observed for each container.hydration_ tombstones container_Container metadata documents a listing showed may have moved since this client last read them, and that still owe a read.metadata_ revalidations containersMaterialized local container tree.dormant_Organization attribution for container metadata retained after access loss.container_ metadata dormant_Durable request for a post-access-restoration crawl and sweep.metadata_ sweep_ requests superseded_Organizations a held folder was re-homed away from by its own owner's signed create (ordinary billing-purge recovery derives fresh replacement ids instead of reusing old container ids).container_ bindings verified_Durable verified creator roles for the session user's personal roots and direct system children.session_ roots
Container document tombstone hold
packages/client-sdk/src/data/sqlite/schema/containerDocumentTombstoneHoldSchema.ts
Container sync watermark
packages/client-sdk/src/data/sqlite/schema/containerSyncWatermarkSchema.ts
Document Loro window
packages/client-sdk/src/data/sqlite/schema/documentLoroWindowSchema.ts
Document attachment
packages/client-sdk/src/data/sqlite/schema/documentAttachmentSchema.ts
Document attachment sighting
packages/client-sdk/src/data/sqlite/schema/documentAttachmentSightingSchema.ts
Document calendar
packages/client-sdk/src/data/sqlite/schema/documentCalendarSchema.ts
document_Per-document index ledger and calendar source metadata for hydrated Loro documents that participate in calendar queries.calendar_ index document_Normalized calendar items projected from hydrated Loro documents (both calendar events and virtual dates such as expirations, birthdays, and to-do due dates).calendar_ items document_Substring index overcalendar_ items_ fts_ trigram document_calendar_items: the word index's shape with thetrigramtokenizer, so a query can match inside words.document_Word index over the title, location, and notes ofcalendar_ items_ fts_ word document_calendar_items: an external-content FTS5 table keyed bycalendar_item_rowid, tokenized withunicode61(diacritics removed).
Document discovery evidence
packages/client-sdk/src/data/sqlite/schema/documentDiscoveryEvidenceSchema.ts
Document listing revalidation
packages/client-sdk/src/data/sqlite/schema/documentListingRevalidationSchema.ts
Document orphan blob reclaim
packages/client-sdk/src/data/sqlite/schema/documentOrphanBlobReclaimSchema.ts
Document placement intent
packages/client-sdk/src/data/sqlite/schema/documentPlacementIntentSchema.ts
Document projection
packages/client-sdk/src/data/sqlite/schema/documentProjectionSchema.ts
document_Local many-to-many projection between documents and containers.container_ projection document_Queryable document summary and detail projection.projection document_Projected document text, split fromprojection_ text documentProjectionso content size never bloats the rows that list/window queries scan.
Document record
packages/client-sdk/src/data/sqlite/schema/documentRecordSchema.ts
document_Full-history persistence for local documents (checkpoint + tail) — the ONLY durable content source.history_ checkpoints document_The local update log: one row per Loro update, serving as both the history tail (restore = checkpoint + tail) and the outbound write queue.history_ updates documentsDurable Loro-backed document records shared by app features.
Document search
packages/client-sdk/src/data/sqlite/schema/documentSearchSchema.ts
document_Local full-text search backing table for hydrated Loro documents.search_ content document_Substring index oversearch_ fts_ trigram document_search_content: the word index's shape with thetrigramtokenizer, so a query can match inside words.document_Word index oversearch_ fts_ word document_search_content: an external-content FTS5 table keyed bysearch_rowid, tokenized withunicode61(diacritics removed).
Document sync verdict
packages/client-sdk/src/data/sqlite/schema/documentSyncVerdictSchema.ts
document_Served updates this device voided because they reused ids of operations it holds under its own peer id with other operations: their writer committed operations as this device, and a reader that judged that update before this device's own voids this device's.peer_ preemptions document_Where a document's last completed pull reached, what it was judged with, and what the pull in progress started from.sync_ progress document_Served updates this device will never apply: their payload is not the update their signed metadata declares, or they cannot join the history built from every earlier served update.void_ updates
Keying checkpoint
packages/client-sdk/src/data/sqlite/schema/keyingCheckpointSchema.ts
Local intent
packages/client-sdk/src/data/sqlite/schema/localIntentSchema.ts
Local schema migrations
packages/client-sdk/src/data/sqlite/migrations/migrateLocalSchema.ts
Local sync notice
packages/client-sdk/src/data/sqlite/schema/localSyncNoticeSchema.ts
Organization data usage
packages/client-sdk/src/data/sqlite/schema/organizationDataUsageSchema.ts
Organization founder
packages/client-sdk/src/data/sqlite/schema/organizationFounderSchema.ts
Organization provisioning attempt
packages/client-sdk/src/data/sqlite/schema/organizationProvisioningAttemptSchema.ts
Organization read model
packages/client-sdk/src/data/sqlite/schema/organizationReadModelSchema.ts
organization_Durable record of a server 403/404 for one requester's presentation projection.presentation_ denials organization_Whole-lane container grants used only by organization presentation reads.read_ model_ container_ grants organization_Normalized organization directory rows.read_ model_ directory_ users organization_Direct users bound to the exact state of their group's membership head.read_ model_ group_ members organization_Normalized visible organization group summaries.read_ model_ groups organization_Requester-scoped fields that must not become organization-global state.read_ model_ requesters organization_Cursor and lane-level fields for one locally projected organization: the exact organization policy head, and the state hash of the reserved Members group's membership head, which the group catalog does not list.read_ model_ state
Organization sync pause
packages/client-sdk/src/data/sqlite/schema/organizationSyncPauseSchema.ts
organization_Organizations whose content sync this user has paused on this device.sync_ pauses organization_Organizations resumed from a local sync pause that still owe one completed full-tree remote container crawl so watermarks advanced while paused cannot hide containers created or moved during the pause.sync_ resume_ resets
Principal grant retirement
packages/client-sdk/src/data/sqlite/schema/principalGrantRetirementSchema.ts
Principal history evidence
packages/client-sdk/src/data/sqlite/schema/principalHistoryEvidenceSchema.ts
principal_Entries are selected by their exact signed leaf, including signature bytes, or by state hash to supply a held head state to public history reads.history_ entries principal_One row per hash a scope's graph mentions.history_ nodes principal_A completed, locally authenticated prefix; never an application trust pin.history_ prefixes
Principal history retention
packages/client-sdk/src/data/sqlite/schema/principalHistoryRetentionSchema.ts
Principal history stage
packages/client-sdk/src/data/sqlite/schema/principalHistoryStageSchema.ts
Principal mutation journal
packages/client-sdk/src/data/sqlite/schema/principalMutationJournalSchema.ts
Principal policy
packages/client-sdk/src/data/sqlite/schema/principalPolicySchema.ts
principal_Exact policy states mapped to every retained bundle chain that contains them.policy_ bundle_ references principal_Every verified policy bundle kept per managed principal: the one current head, and older bundles retained for exact-reference verification and epoch key unwrapping.policy_ bundles principal_Durable organization ownership for every managed-principal cache, and its monotonic anti-rollback pin.policy_ checkpoints
Security incident
packages/client-sdk/src/data/sqlite/schema/securityIncidentSchema.ts
Trusted user identity pin
packages/client-sdk/src/data/sqlite/schema/trustedUserIdentityPinSchema.ts
User device enrollment
packages/client-sdk/src/data/sqlite/schema/userDeviceEnrollmentSchema.ts
Verified manifest bundle
packages/client-sdk/src/data/sqlite/schema/verifiedManifestBundleSchema.ts