Tearleads

document_peer_owners API Postgres table

The user that owns each Loro peer of a document.

Declared in packages/api-shared/src/schema/documentPeerOwners.ts

Description

A peer's committed frontier is the highest end_counter (exclusive) of its document_update_spans rows. Under the document head lock, a write may re-assert any peer's counters below that frontier, but only the peer's owner may extend it.

Like the span rows, these rows carry no foreign keys; a document purge deletes both.

Columns

  • document_iduuid
    • not null

    Document whose Loro peer this row assigns.

  • peer_idtext
    • not null

    The Loro peer id, as in document_update_spans.peer_id.

  • owner_user_iduuid
    • not null

    User whose accepted write claimed the peer while it had no owner; only this user may extend the peer's committed frontier.

  • created_attimestamp
    • not null
    • default now()

    Server-side timestamp of the claim.

Keys and constraints

  • Primary key(document_id, peer_id)