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