eventuary_postgres/lib.rs
1//! PostgreSQL event log backend for [eventuary](https://crates.io/crates/eventuary).
2//!
3//! Provides an append-only events table backed by `sqlx::PgPool` with source
4//! cursors (`PgCursor`) ordered by `BIGSERIAL` sequence. `PgReader` is a source
5//! reader: its acker advances only the active in-memory stream cursor, and nack
6//! leaves the row eligible for redelivery by that stream.
7//!
8//! Durable consumer progress is owned by `PgCheckpointStore` and composed with
9//! `eventuary_core::io::reader::CheckpointReader`. Checkpoints are keyed by
10//! `(consumer_group_id, stream_id, cursor_id)` and store the full cursor as JSON.
11//!
12//! Schema setup is component-owned. Use each component's `Component::schema_sql(config)`
13//! method (`PgWriter::schema_sql`, `PgReader::schema_sql`, `PgCheckpointStore::schema_sql`, …)
14//! to generate DDL, and the corresponding `Component::connect(pool, config).await` or
15//! `Component::prepare_schema(pool, config).await` to apply it.
16//!
17//! `PgDatabase::connect(...)` only opens a pool and does not create Eventuary tables.
18
19pub mod buffer;
20pub mod checkpoint;
21pub mod claim_buffer;
22pub mod coordinator;
23pub mod database;
24pub mod dedupe;
25mod event_log;
26pub mod multiplexer;
27pub mod partitioning;
28pub mod reader;
29pub mod relation;
30mod schema;
31pub mod watermark;
32pub mod writer;