ursa.register._writer

Module-private write boundary between :mod:ursa.register and the catalog backend.

The four register.* functions only ever need to insert a row, never read or query. This Protocol captures exactly that surface so test code can swap in an in-memory writer with no Lance dependency.

Method names mirror :class:ursa.catalog.Catalog’s typed wrappers (add_participant / add_recording / add_modality / add_event), so the real :class:Catalog structurally satisfies this Protocol without an adapter layer.

Implementations MUST raise :class:ursa.catalog.CatalogRowExists (or any subclass — :class:~ursa.catalog.CatalogPKConflict qualifies) when the row’s __primary_key__ is already present in the target table. Phase 1a is intentionally non-idempotent — see ENG-1074.

Module Contents

Classes

CatalogWriter

Insert-only contract that :class:ursa.catalog.Catalog satisfies.

API

class ursa.register._writer.CatalogWriter[source]

Bases: typing.Protocol

Insert-only contract that :class:ursa.catalog.Catalog satisfies.

add_participant(row: ursa.catalog.ParticipantRow) None[source]
add_recording(row: ursa.catalog.RecordingRow) None[source]
add_modality(row: ursa.catalog.ModalityRow) None[source]
add_event(row: ursa.catalog.EventRow) None[source]