ankurah_storage_sqlite/lib.rs
1//! SQLite storage engine for Ankurah
2//!
3//! Provides a lightweight embedded database storage option using SQLite.
4//! Sits between Sled (pure KV) and Postgres (full SQL server), offering:
5//!
6//! - Single-file database (portable, easy backup)
7//! - Full SQL query capabilities without external server
8//! - Native support on all platforms including mobile (iOS, Android)
9//!
10//! # SQLite Version Requirements
11//!
12//! This implementation requires SQLite 3.45.0 or later for JSONB support.
13//! The `rusqlite` crate with the "bundled" feature includes a compatible
14//! SQLite version by default. JSONB support enables:
15//!
16//! - `jsonb()` function for type-aware JSON comparisons
17//! - `->` and `->>` operators for JSON path traversal
18//! - Efficient JSONB storage as BLOB
19//!
20//! See [SQLite JSON documentation](https://sqlite.org/json1.html) for details.
21//!
22//! # Example
23//!
24//! ```rust,ignore
25//! use ankurah_storage_sqlite::SqliteStorageEngine;
26//!
27//! // Open a file-based database
28//! let storage = SqliteStorageEngine::open("myapp.db").await?;
29//!
30//! // Or use an in-memory database for testing
31//! let storage = SqliteStorageEngine::open_in_memory().await?;
32//! ```
33
34mod connection;
35mod engine;
36mod error;
37pub mod sql_builder;
38mod value;
39
40pub use connection::SqliteConnectionManager;
41pub use engine::{SqliteBucket, SqliteStorageEngine};
42pub use error::SqliteError;
43pub use value::SqliteValue;