Expand description
PostgreSQL-backed stores for tellus persistence: PostgresStore implements both EventStore and SnapshotStore over one shared connection pool, so a single value, cheap to clone, wires a whole Persistence.
Events live in the events table with the primary key (entity_type, entity_id, seq_no),
snapshots in snapshots keyed by (entity_type, entity_id), only the latest one retained.
The schema is embedded and applied via PostgresStore::migrate. Appends are a single atomic,
conditional statement: a stale expected next sequence number, below or above the actual one,
fails with AppendError::Conflict and leaves the stream untouched, which is tellus’s fencing
guarantee. An empty append inserts nothing but is still fenced.
Structs§
- Postgres
Store - A persistence store backed by PostgreSQL, implementing both EventStore and SnapshotStore over a shared connection pool; cheap to clone.
Enums§
- Error
- Errors possibly returned by PostgresStore.