Skip to main content

Crate eventcore_postgres

Crate eventcore_postgres 

Source
Expand description

PostgreSQL event store backend for EventCore.

This crate provides a production-grade PostgresEventStore backed by PostgreSQL, with ACID transactions, advisory locks, and connection pooling via sqlx.

Event immutability is enforced by PostgreSQL triggers. Stream pattern matching follows the conventions described in ADR-0047.

PostgresEventStore implements EventStore, EventReader, CheckpointStore, and ProjectorCoordinator from eventcore-types.

§Getting Started

use eventcore_postgres::PostgresEventStore;

let store = PostgresEventStore::new("postgres://user:pass@localhost/mydb").await?;

Structs§

CoordinationGuard
Guard type that releases leadership when dropped.
MaxConnections
Maximum number of database connections in the pool.
PostgresCheckpointStore
Postgres-backed checkpoint store for tracking projection progress.
PostgresConfig
Configuration for PostgresEventStore connection pool.
PostgresEventStore
PostgreSQL-backed event store implementing EventCore’s storage traits.
PostgresProjectorCoordinator
Postgres-backed projector coordinator for distributed leadership.

Enums§

CoordinationError
Error type for projector coordination operations.
PostgresCheckpointError
Error type for PostgresCheckpointStore operations.
PostgresEventStoreError
Errors that can occur when creating a PostgresEventStore.