zlayer_store/lib.rs
1//! Centralized domain DB access for `ZLayer`.
2//!
3//! This crate is the home for the generic persistence machinery shared across
4//! `ZLayer`'s `SQLite`-backed resource stores. Increment 1 hosts:
5//!
6//! - [`StorageError`] — the shared error type returned by every storage
7//! operation (moved verbatim from `zlayer-api::storage`).
8//! - [`JsonStore`] and its companions [`IndexSpec`] / [`JsonTable`] — the
9//! generic "blob + optional unique indexes" `SQLite` adapter. Its
10//! engine-neutral name lets the `ZLayerZQL` mirror swap in a ZQL-backed
11//! `JsonStore` of identical API by overriding the `backend` module alone.
12//!
13//! These were lifted out of `crates/zlayer-api/src/storage/` so that domain DB
14//! access can be centralized here. `zlayer-api` re-exports them unchanged, so
15//! every existing caller (`zlayer_api::storage::{StorageError, IndexSpec,
16//! JsonTable, JsonStore}`) keeps compiling.
17
18mod backend;
19mod error;
20
21pub use backend::{IndexSpec, JsonStore, JsonTable};
22pub use error::StorageError;