sqlite_embedded/lib.rs
1//! Depot-backed SQLite client.
2//!
3//! Provides the native SQLite VFS used by Rivet actors.
4//!
5//! This is a pure Rust library. N-API bindings and transport clients
6//! live in separate crates that compose this one.
7//!
8//! The SQLite implementation used by `rivetkit-napi` is defined in this crate.
9//! Keep its storage layout and behavior in sync with the internal SQLite
10//! data-channel spec.
11//!
12//! Key invariants:
13//! - PRAGMA settings
14//! - Delete and truncate behavior
15//! - Journal and BATCH_ATOMIC behavior
16
17/// Unified native database handles and open helpers.
18#[cfg(feature = "transport")]
19pub mod database;
20
21/// SQLite optimization feature flags.
22#[cfg(feature = "transport")]
23pub mod optimization_flags;
24
25#[cfg(feature = "transport")]
26mod page_buffer;
27
28/// Guards for connections that run SQL sent by an untrusted peer.
29#[cfg(feature = "transport")]
30pub mod guard;
31
32/// SQLite query execution helpers.
33#[cfg(feature = "transport")]
34pub mod query;
35
36/// Lightweight SQLite page classification for prefetch planning.
37#[cfg(feature = "transport")]
38pub mod sqlite_page;
39
40pub use sqlite_types as types;
41
42/// Custom SQLite VFS for actor-side depot transport.
43pub mod vfs;
44
45/// Single-threaded native SQLite command worker.
46#[cfg(feature = "transport")]
47pub mod worker;
48
49/// Process-wide SQLite page cache shared by every connection.
50#[cfg(feature = "transport")]
51pub mod pager_cache;
52
53