chronon-backend-sqlite 0.1.4

SQLite SchedulerStore adapter for Chronon
Documentation

chronon-backend-sqlite

Embedded, file-backed SQLite SchedulerStore adapter for Chronon. SQLite serializes writes — one Chronon scheduler + worker pool on a single host is fine; for concurrent claim-heavy workloads prefer PostgreSQL or the Postgres + Redis composite backend.

Compose with Chronon

use std::sync::Arc;
use chronon::prelude::*;
use chronon_backend_sqlite::SqliteSchedulerStore;

let store: Arc<dyn SchedulerStore> = Arc::new(
    SqliteSchedulerStore::new("/tmp/chronon-example.db").await?,
);
let chronon = ChrononBuilder::new()
    .scheduler_store(store)
    .embedded()
    .build()?;

Runnable examples (full runbook: chronon/README.md):

# Embedded (standalone)
cargo run -p uf-chronon --example sqlite_boot --features sqlite

# Coordinator–worker same-host — shared path; coordinator first; unique worker ids
export CHRONON_SQLITE_PATH=/tmp/chronon-split.db
# Terminal 1
cargo run -p uf-chronon --example sqlite_coordinator_daemon --features sqlite
# Terminal 2
CHRONON_INSTANCE_ID=worker-a cargo run -p uf-chronon --example sqlite_worker_daemon --features sqlite
# Terminal 3
CHRONON_INSTANCE_ID=worker-b cargo run -p uf-chronon --example sqlite_worker_daemon --features sqlite

Topology docs: Embedded / Coordinator–worker.

Configuration

API Use when
SqliteSchedulerStore::new(path) File on disk (/var/lib/chronon/chronon.db)
SqliteSchedulerStore::connect(url) Full URL including :memory: for tests
SqliteSchedulerStore::from_pool(pool) Host already owns an sqlx pool
CHRONON_SQLITE_PATH Shared file path for examples / same-host split

Schema bootstrap runs automatically on connect.

Cargo feature

chronon = { git = "...", default-features = false, features = ["sqlite"] }

Contract tests

cargo test -p chronon-backend-sqlite --tests

Runs in PR CI alongside chronon-backend-mem.

Documentation

cargo doc -p chronon-backend-sqlite --no-deps --open

See also: chronon-backend-sql-common.