Postgres schema reference
Every table the API keeps in Postgres, with its columns, keys, indexes, and what each holds.
58 tables, as of migration 0028_operator_organization. docs/database/postgres.json
The API's tables in Postgres (PlanetScale in production, PGlite or Postgres in tests), defined with Drizzle in packages/api-shared/src/schema. They change only through the append-only migrations in packages/api-shared/drizzle; API persistence describes the adapters and the rules each migration follows.
Document and blob bytes reach the server already encrypted. The tables hold that ciphertext, the signed metadata the server verifies, and the access state it enforces; blob bytes live in the object store, which these rows name by storage key.
Access events
Access manifests
packages/api-shared/src/schema/accessManifests.ts
access_Expanded direct grants for container access manifests.manifest_ container_ grant_ projection access_Indexed document-to-container links committed by a document manifest.manifest_ document_ link_ projection access_Current access manifest pointer for each access-controlled object.manifest_ heads access_Indexed referenced-principal heads for an access manifest.manifest_ principal_ head_ projection access_Content-addressed access manifests for containers and document link sets.manifests document_Durable proof that an authorized user was served a document manifest while the document was live.manifest_ observations
Blob audit objects
Blob content keys
Blobs
Container keying
Containers
Document content keys
Document inline rekey commits
packages/api-shared/src/schema/documentInlineRekeyCommits.ts
Document links
Document peer owners
Documents and updates
packages/loro/src/server/schema.ts
document_The Loro peer counters each stored update covers: one row per update and peer, decoded from its signed version vectors.update_ spans document_Each document's encrypted Loro update history: one row per accepted update.updates documentsOne row per server document: the anchor of its encrypted Loro history indocument_updatesand the counters listings read without scanning it.
Groups
Job runs
Operator organization
Organization billing invoice events
packages/api-shared/src/schema/organizationBillingInvoiceEvents.ts
Organization billing lifecycle events
packages/api-shared/src/schema/organizationBillingLifecycleEvents.ts
Organization billing seats
Organization read models
Organizations
Principal directory bindings
packages/api-shared/src/schema/principalDirectoryBindings.ts
Principal history index nodes
packages/api-shared/src/schema/principalHistoryIndexNodes.ts
Principal history progress
Principal policy commits
Principal policy mutation acknowledgements
packages/api-shared/src/schema/principalPolicyMutationAcknowledgements.ts
Principal states
packages/api-shared/src/schema/principalStates.ts
principal_Wrapped principal key material for the current direct members of a principal.member_ envelopes principal_Queryable membership and role projection for signed principal states.membership_ projection principal_Encrypted payloads for signed principal state versions.state_ payloads principal_Signed state history for managed recipient principals.states