Skip to main content

boson_backend_sql_common/
lib.rs

1//! Shared SQL [`QueueBackend`](boson_core::QueueBackend) for `PostgreSQL` and `SQLite`.
2//!
3//! Reference implementation for **Developing the backend**; integrators typically use
4//! [`boson_backend_sqlite::SqliteQueueBackend`](https://docs.rs/boson-backend-sqlite) or
5//! [`boson_backend_postgres::PostgresQueueBackend`](https://docs.rs/boson-backend-postgres).
6//!
7//! ## Entry points
8//!
9//! - [`SqlQueueBackend`] — connect, schema bootstrap, and trait implementation
10//! - [`SqlDialect`] / [`SqlPool`] — engine selection and pool wrapper
11//!
12//! ## Example (integrator wiring)
13//!
14//! ```rust,no_run
15//! use boson_backend_sql_common::SqlQueueBackend;
16//!
17//! # async fn example() -> boson_core::Result<()> {
18//! let backend = SqlQueueBackend::connect_sqlite("sqlite://:memory:").await?;
19//! # Ok(())
20//! # }
21//! ```
22
23mod backend;
24mod delegate;
25mod enqueue_rate;
26mod error_map;
27mod jobs;
28mod leases;
29mod macros;
30mod queue_impl;
31mod row;
32mod runs;
33mod schema;
34mod task_config;
35
36pub use backend::{SqlDialect, SqlPool, SqlQueueBackend};
37pub use enqueue_rate::EnqueueRateLimiter;
38
39pub(crate) use backend::bind_sql;