ff-backend-sqlite 0.14.0

FlowFabric EngineBackend impl — SQLite dev-only backend (RFC-023, Phase 1a scaffold)
Documentation
[package]
name = "ff-backend-sqlite"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
description = "FlowFabric EngineBackend impl — SQLite dev-only backend (RFC-023, Phase 1a scaffold)"

[features]
# Mirror ff-core / ff-backend-postgres feature topology so method-gate
# `#[cfg]`s line up with the trait surface.
default = ["core", "streaming", "suspension"]
core = ["ff-core/core"]
streaming = ["ff-core/streaming"]
# RFC-025 Phase 4: `list_expired_leases` trait method rides
# `ff-core`'s `suspension` gate. Default-on so the in-tree release
# feature-set matches Valkey + Postgres parity. Downstream consumers
# can disable via `default-features = false`.
suspension = ["ff-core/suspension"]

[dependencies]
# Phase 1a: ff-core features match ff-backend-postgres so the SQLite
# impl honours the same `EngineBackend` method surface. Trait impl
# bodies arrive in Phase 2+; Phase 1a returns `EngineError::Unavailable`
# from every method except `capabilities()` + `prepare()`.
ff-core = { version = "0.14.0", path = "../ff-core", default-features = false, features = ["core"] }

# SQLite transport. Bundled SQLite is deliberately selected to decouple
# the backend from the operating distro's libsqlite3 version — RFC-023
# §7.1 owner recommendation. JSON1 + RETURNING (>= 3.35) rely on this.
sqlx = { workspace = true, features = ["sqlite", "runtime-tokio", "macros", "migrate", "json", "chrono", "uuid"] }
# Explicit `libsqlite3-sys` dep with the `bundled` feature enabled. sqlx
# 0.8 does not expose a `sqlite-bundled` feature alias, so bundled-mode
# has to be turned on via a direct dep + Cargo's feature unification.
# Without this, sqlx's `sqlite` feature pulls `libsqlite3-sys` in
# system-link mode and the "bundled" claim in the comment above silently
# does not hold. Version pin must match the one sqlx 0.8 resolves to.
libsqlite3-sys = { version = "0.30", features = ["bundled"] }

async-trait = { workspace = true }
tokio = { workspace = true, features = ["sync"] }
tracing = { workspace = true }
uuid = { workspace = true }
# Phase 2a.3: `append_frame` DurableSummary path reads + merges the
# stored `document_json` in Rust (RFC 7396) before writing it back, so
# the crate needs direct serde_json access.
serde_json = { workspace = true }
# RFC-023 Phase 2b.2.1: suspend_ops hex-encodes opaque handles for the
# dedup-replay cache and signal payload bytes for the member_map blob.
# Matches the PG reference shape (`ff-backend-postgres/src/suspend_ops.rs`).
hex = "0.4"
# Phase 2b.2.2: outbox_cursor returns a `futures_core::Stream`-adapter
# struct so Phase 3 `subscribe_*` trait impls can box it as
# `Pin<Box<dyn Stream<Item=...>>>` — same dep shape as
# `ff-backend-postgres` uses for its lease/completion subscribers.
futures-core = { workspace = true }

[package.metadata.cargo-machete]
# `libsqlite3-sys` is not imported directly; it is declared so Cargo's
# feature unification enables the `bundled` feature on sqlx's transitive
# use of it (RFC-023 §7.1). cargo-machete can't see through feature
# propagation, so whitelist the dep here.
ignored = ["libsqlite3-sys"]

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util"] }
# Env-var isolation across the two test files (`guard.rs` +
# `capabilities.rs`): SQLite tests read `FF_DEV_MODE` from the process
# environment, and `cargo test` runs per-binary tests in parallel by
# default. `serial_test` enforces per-`#[serial]` ordering.
serial_test = "3"