Zero-polling job queues inside SQLite. No Redis, no daemon, no polling.
sqliteq adds durable background jobs to a SQLite app with one table, one crate, and no busy loop. Workers sleep on
OS-native file watcher events and claim jobs with an atomic SQLite UPDATE ... RETURNING statement. WAL mode is used
by default so enqueue can compose with normal SQLite writes.
cargo add sqlitequse serde_json::json;
use sqliteq::Sqliteq;
let sq = Sqliteq::open("app.db").await?;
let emails = sq.queue("emails");
emails.enqueue(json!({"to": "alice@example.com"})).await?;
let job = emails.claim("worker-1").await?;
job.ack().await?;Run local benchmarks before publishing numbers:
cargo run -p sqliteq-cli -- bench --db bench.db --markdowncargo run -p sqliteq-cli -- --db app.db init
cargo run -p sqliteq-cli -- --db app.db enqueue --queue emails '{"to":"alice@example.com"}'
cargo run -p sqliteq-cli -- --db app.db statsStart a shell worker:
cargo run -p sqliteq-cli -- --db app.db worker --queue emails -- ./examples/worker.shsqliteq watches the SQLite database, the parent directory, and WAL/SHM sidecar files through notify. When another
process writes to the database, waiting workers wake up and run a targeted atomic claim query. If a filesystem watcher
misses an event, a low-frequency fallback wake checks for work without becoming the primary mechanism.
- SQLite-backed durable queue table
- Atomic concurrent claim with
UPDATE ... RETURNING - Priority, delayed jobs, retries, visibility timeout, and dead-letter jobs
- Transactional enqueue through a caller-owned SQLite transaction
- CLI commands:
enqueue,worker,stats,purge,bench,init,version - Integration tests for core queue behavior, watcher wake, and concurrent workers
- Durable pub/sub channels
- Cron scheduler
- Python bindings after Rust API and wheel packaging are stable
- Dashboard and extra language bindings after repeated user demand
sqliteq is a single-file, single-machine queue. It is not a distributed queue and does not replace Postgres-backed
or broker-backed systems when multiple machines must coordinate claims. See docs/limitations.md
for filesystem watcher, WAL, and concurrency details.
MIT
