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. `SqliteWriter::connect(conn, config)`
14//! prepares only the event-log table, while
15//! `SqliteDedupeStore::connect(conn, config)` prepares only the dedupe table.
16//! `SqliteDatabase::open(...)` only opens a connection and does not create
17//! Eventuary tables.
18//!
19//! Also ships sqlite-backed implementations of the IO store traits:
20//! - [`SqliteMultiplexerStore`]
21//! - [`SqliteBufferStore`]
22//! - [`SqliteDedupeStore`]
23//! - [`SqliteCheckpointStore`]
24//! - [`SqliteWatermarkStore`]
25
26pub mod buffer_store;
27pub mod checkpoint_store;
28pub mod coordinated_reader;
29pub mod database;
30pub mod dedupe_store;
31pub mod event_log;
32pub mod multiplexer_store;
33pub mod partition_coordinator;
34pub mod reader;
35pub mod relation;
36pub mod schema;
37pub mod watermark_store;
38pub mod writer;
39
40pub use buffer_store::{SqliteBufferStore, SqliteBufferStoreConfig, SqliteBufferStoreId};
41pub use checkpoint_store::{SqliteCheckpointStore, SqliteCheckpointStoreConfig};
42pub use coordinated_reader::{
43    SqliteCoordinatedAcker, SqliteCoordinatedCursor, SqliteCoordinatedReader,
44    SqliteCoordinatedReaderConfig, SqliteCoordinatedStream, SqliteCoordinatedSubscription,
45};
46pub use dedupe_store::{SqliteDedupeStore, SqliteDedupeStoreConfig};
47pub use event_log::{SqliteEventLogSchema, SqliteEventLogSchemaConfig};
48pub use multiplexer_store::{SqliteMultiplexerStore, SqliteMultiplexerStoreConfig};
49pub use partition_coordinator::{SqlitePartitionCoordinator, SqlitePartitionCoordinatorConfig};
50pub use watermark_store::{SqliteWatermarkStore, SqliteWatermarkStoreConfig};