Skip to main content

eventuary_sqlite/
lib.rs

1//! SQLite event log backend for [eventuary](https://crates.io/crates/eventuary).
2//!
3//! Provides an append-only events table with auto-incrementing sequence cursors
4//! (`SqliteCursor`). `SqliteReader` is a source reader: its acker advances only
5//! the active in-memory stream cursor, and nack leaves the row eligible for
6//! redelivery by that stream. SQLite work runs in `tokio::task::spawn_blocking`
7//! to avoid blocking the async runtime.
8//!
9//! Durable consumer progress is owned by `SqliteCheckpointStore` and composed
10//! with `eventuary_core::io::reader::CheckpointReader`. Checkpoints are keyed by
11//! `(consumer_group_id, stream_id, cursor_id)` and store the full cursor as JSON.
12//!
13//! Schema setup is component-owned. Each component exposes a `Component::schema_sql(config)`
14//! method (`SqliteWriter::schema_sql`, `SqliteCheckpointStore::schema_sql`, etc.) and
15//! `Component::prepare_schema(conn, config)` to apply it.
16//! `SqliteDatabase::open(...)` only opens a connection and does not create Eventuary tables.
17//!
18//! Also ships sqlite-backed implementations of the IO store traits:
19//! - [`multiplexer::SqliteMultiplexerStore`]
20//! - [`buffer::SqliteBufferStore`]
21//! - [`dedupe::SqliteDedupeStore`]
22//! - [`checkpoint::SqliteCheckpointStore`]
23//! - [`watermark::SqliteWatermarkStore`]
24
25pub mod buffer;
26pub mod checkpoint;
27pub mod coordinator;
28pub mod database;
29pub mod dedupe;
30mod event_log;
31pub mod multiplexer;
32pub mod partitioning;
33pub mod reader;
34pub mod relation;
35mod schema;
36pub mod watermark;
37pub mod writer;