CRDT Operations

Read State

SELECT crdt_state('collab_docs', 'doc123');

Returns the current merged state of the CRDT document.

Apply Delta

SELECT crdt_apply('collab_docs', 'doc123', '<delta_bytes>');

Applies a Loro CRDT delta to the document. On Origin, the delta goes through Raft consensus. On Lite, it is applied locally and queued for sync.

Conflict Policies

Conflict policies (last-writer-wins, field-merge, custom) are configured per-collection at create time and via the native NodeDB protocol's ALTER POLICY command. SQL DDL for inspecting and updating conflict policies — SHOW CONFLICT POLICY ON <collection> and ALTER COLLECTION ... SET ON CONFLICT ... — is available alongside the rest of the SQL surface. See the protocol reference for the native-protocol form, and CRDT Sync for full sync protocol details.