persistant 0.18.21

A thin persistence layer over Apache OpenDAL for blobs and records by key: declared capabilities, atomic replace, typed records, and a blocking facade for synchronous callers.
Documentation
[workspace]
members = [".", "crates/persistant-core", "crates/persistant-blob", "crates/persistant-opendal", "crates/persistant-kv", "crates/persistant-relational", "crates/persistant-sqlx", "crates/persistant-migrate", "crates/persistant-macros"]

[workspace.package]
version = "0.18.21"

[workspace.dependencies]
persistant-core = { version = "0.18.21", path = "crates/persistant-core" }
persistant-blob = { version = "0.18.21", path = "crates/persistant-blob" }
persistant-kv = { version = "0.18.21", path = "crates/persistant-kv" }
persistant-opendal = { version = "0.18.21", path = "crates/persistant-opendal" }
persistant-relational = { version = "0.18.21", path = "crates/persistant-relational" }
persistant-sqlx = { version = "0.18.21", path = "crates/persistant-sqlx" }
persistant-migrate = { version = "0.18.21", path = "crates/persistant-migrate" }
persistant-macros = { version = "0.18.21", path = "crates/persistant-macros" }

[package]
name = "persistant"
version.workspace = true
edition = "2024"
rust-version = "1.94"
description = "A thin persistence layer over Apache OpenDAL for blobs and records by key: declared capabilities, atomic replace, typed records, and a blocking facade for synchronous callers."
license = "MIT OR Apache-2.0"
repository = "https://github.com/ciresnave/PersistAnt"
readme = "README.md"
keywords = ["storage", "persistence", "opendal", "atomic", "blob"]
categories = ["filesystem", "database-implementations"]
include = [
    "src/**",
    "tests/**",
    "examples/**",
    "matrix/**",
    "README.md",
    "CHANGELOG.md",
    "SECURITY.md",
    "LICENSE-MIT",
    "LICENSE-APACHE",
    "Cargo.toml",
]

[lib]
name = "persistant"
path = "src/lib.rs"

[dependencies]
opendal = { version = "0.59.4", default-features = false, features = ["services-fs"] }
futures-util = { version = "0.3.34", default-features = false }
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.151"
tokio = { version = "1.53.2", features = ["rt", "sync"] }

# The other kinds, opt-in. Off by default: a program that only wants `Store` compiles none of them.
persistant-core = { workspace = true, optional = true }
persistant-blob = { workspace = true, optional = true }
persistant-kv = { workspace = true, optional = true }
persistant-relational = { workspace = true, optional = true }
persistant-opendal = { workspace = true, optional = true }
# `sqlx-driver` needs a Rust 1.94 compiler (sqlx 0.9); the rest of this crate builds on 1.94 too (UniSQL, which `persistant-kv` translates through).
persistant-sqlx = { workspace = true, optional = true }
# The compile-time SQL macro (a proc-macro crate): opt in with `sql-macros`.
persistant-macros = { workspace = true, optional = true }

[features]
# Each feature re-exports one crate under the module named in `src/lib.rs`. None changes `Store`.
core = ["dep:persistant-core"]
blob = ["dep:persistant-blob", "core"]
blob-tracing = ["blob", "persistant-blob/tracing"]
relational = ["dep:persistant-relational"]
relational-tracing = ["relational", "persistant-relational/tracing"]
kv = ["dep:persistant-kv", "blob", "relational", "core"]
kv-tracing = ["kv", "persistant-kv/tracing"]
# `persistant::kv::text::TextIndex`: a text index over any kv backend with atomic batches (docs/DESIGN-TEXT-INDEX.md).
text-index = ["kv", "persistant-kv/text-index"]
# `persistant::kv::text_tokenizer::tokenize`: text to `(term, frequency)` for `TextIndex::put` (adds `unicode-segmentation` and `unicode-normalization`).
text-index-tokenizer = ["text-index", "persistant-kv/text-index-tokenizer"]
opendal-driver = ["dep:persistant-opendal", "blob"]
sqlx-driver = ["dep:persistant-sqlx", "relational"]
# `persistant::registry`: needs in, sorted backends out, `open_named` by the id kept in config. `registry`
# offers `memory` and `fs`; `registry-sqlite` adds `sqlite` and `sqlite-full`; `registry-postgres`, `registry-mysql` add the servers; `all-backends` is every one.
registry = ["kv", "core", "opendal-driver"]
registry-sqlite = ["registry", "sqlx-driver", "persistant-sqlx/sqlite"]
registry-postgres = ["registry", "sqlx-driver"]
registry-mysql = ["registry", "sqlx-driver", "persistant-sqlx/mysql"]
all-backends = ["registry", "registry-sqlite", "registry-postgres", "registry-mysql"]
# `persistant::sql!`: build-time checked and translated SQL, run with `execute_sql` / `query_sql`.
sql-macros = ["dep:persistant-macros", "relational", "persistant-relational/sql"]
# `FromValue` / `ToValue` for `uuid::Uuid`, `chrono` and `serde_json::Value` (canonical text; see docs/DECODER-AUDIT.md).
sql-uuid = ["sql-macros", "persistant-relational/uuid"]
sql-chrono = ["sql-macros", "persistant-relational/chrono"]
sql-json = ["sql-macros", "persistant-relational/json"]
# `persistant::sqlx_query!`, `sqlx_query_as!`, `sqlx_query_scalar!`: sqlx's argument shape, typed from `.sqlx` offline data, run through UniSQL and PersistAnt (docs/DESIGN-SQLX-BRIDGE.md). `sqlx-query-checked` also runs sqlx's own check of each literal (your crate depends on sqlx with its `macros` feature).
sqlx-query = ["sql-macros"]
sqlx-query-checked = ["sqlx-query", "persistant-macros/sqlx-check"]

[[test]]
name = "registry_erased"
required-features = ["registry-sqlite"]

[[test]]
name = "text_index"
required-features = ["text-index"]

[[test]]
name = "text_index_sqlite"
required-features = ["text-index", "registry-sqlite"]

[[test]]
name = "text_index_certify"
required-features = ["text-index"]

[[test]]
name = "batch_erased"
required-features = ["registry-sqlite"]

[[test]]
name = "registry_listed_opens"
required-features = ["registry-sqlite"]

[[test]]
name = "text_erased"
required-features = ["text-index", "registry-sqlite"]

[[test]]
name = "text_erased_many"
required-features = ["text-index", "registry-sqlite"]

[[test]]
name = "text_tokenizer"
required-features = ["text-index-tokenizer"]

[[example]]
name = "hello"
required-features = ["registry"]

[[example]]
name = "registry_blob"
required-features = ["registry"]

[[example]]
name = "registry_blob_stream"
required-features = ["registry"]

[[example]]
name = "registry_instead_of_config"
required-features = ["registry"]

[dev-dependencies]
# tests/capant_view.rs asks capant the questions the gate answers.
capant = "0.1.0"
tempfile = "3.27.0"
tokio = { version = "1.53.2", features = ["rt-multi-thread", "macros"] }