Skip to content

app.doc_snapshots

TableRow level security on

One live co-edited document per row and field (Section 5, Section 7.3): the merged Yjs state, the update sequence it covers and a plain text projection. Readable by whoever can read the row it belongs to; written only through app.open_doc, app.append_doc_update and app.compact_doc.

Primary key: id

Columns of app.doc_snapshots
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org. A row never moves to another org.References app.organizations.id
subject_tabletextNoTable of the row the document belongs to.References private.coedit_subjects.table_name
subject_iduuidNoRow the document belongs to.
doc_keytextNoWhich document of the row, for example body.References private.coedit_subjects.doc_key
generationintegerNoRaised when the document is reseeded from its row after the row's text changed outside the editor; updates of an older generation are refused.
statebyteaYesMerged Yjs state (an encoded update) covering every update up to through_seq; NULL before the first compaction.
through_seqbigintNoHighest update sequence folded into state.
last_seqbigintNoHighest update sequence issued for the document.
text_snapshottextYesPlain text of the document at the last compaction, or the row's text it was seeded from.
base_updated_attimestamp with time zoneYesThe row's updated_at when the editor last wrote its text into the row or seeded from it.
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id