vox-db API Reference (generated)
Crate: vox-db · Version: 0.6.0 · Target: Library (lib.rs)
Codex / VoxDb facade: schema migrations, store ops, Turso/libSQL access for the Vox workspace.
Crate Overview
Section titled “Crate Overview”vox-db — High-level database facade for Vox
Section titled “vox-db — High-level database facade for Vox”Provides a unified API over Turso/libSQL for packages, code artifacts, agent memory, Codex
reactivity, and related tables. Prefer this crate over talking to turso::Connection directly
in application code.
Nomenclature (avoid mixing layers)
Section titled “Nomenclature (avoid mixing layers)”| Name | What it is |
|---|---|
[VoxDb] | Stable Rust type for this facade; use it in signatures and tests. |
[Codex] | Type alias for VoxDb — same type, product-facing name in docs/UI. |
| Arca | Internal name for schema + SQL owned by this crate (crates/vox-db/src/schema/). |
vox-package | Package registry / artifacts — not the SQL schema SSOT. |
Use [VoxDb::store] (async method) for content-addressed blob writes (ops_cas); it is not a getter.
Connection modes
Section titled “Connection modes”- Remote (Turso cloud) — always available
- Local (file-based Turso) —
localfeature (default) - In-memory —
DbConfig::Memory, tests only (localfeature) - Embedded replica (local + cloud sync) —
replicationfeature
Canonical store (SSOT)
Section titled “Canonical store (SSOT)”User-global relational data uses [DbConfig::resolve_canonical] / [canonical_store::resolve_canonical_config].
Repo-backed interactive surfaces default to the workspace journey store (.vox/store.db) via
[workspace_journey_store::connect_workspace_journey_optional]; set VOX_WORKSPACE_JOURNEY_STORE=canonical
for legacy user-global / Turso. See [canonical_store] and [workspace_journey_store].
Turso batch SQL caveat
Section titled “Turso batch SQL caveat”Built-in and app-supplied migrations run through [turso::Connection::execute_batch], which uses
execute and fails on statements that return rows (e.g. bare SELECT, assignment PRAGMA
unless handled with pragma_update). [VoxDb::connect] / [VoxDb::open] apply pragmas via
pragma_update and skip empty migration bodies; see also [VoxDb::apply_migrations].
use vox_db::{VoxDb, DbConfig};
#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> {let db = VoxDb::connect(DbConfig::Remote {url: "turso://my-db.turso.io".to_string(),token: "my-token".to_string(),}).await?;
let hash = db.store("fn", b"fn hello(): return 42").await?;println!("Stored: {hash}");Ok(())}Features
Section titled “Features”| Feature | Default / Enables |
|---|---|
default | local |
host-integration | dep:keyring, dep:vox-config, dep:vox-repository, dep:vox-secrets |
legacy-import | quarantine |
local | — |
quarantine | — |
replication | — |
test-support | — |
Workspace Dependencies
Section titled “Workspace Dependencies”| Dependency | Kind |
|---|---|
vox-ast | Normal |
vox-config | Normal |
vox-db-types | Normal |
vox-mesh-types | Normal |
vox-orchestrator-types | Normal |
vox-plugin-types | Normal |
vox-repository | Normal |
vox-secrets | Normal |
vox-telemetry | Normal |
vox-test-harness | Development |
Public API Surface
Section titled “Public API Surface”Modules
Section titled “Modules”| Module | Description |
|---|---|
auto_migrate | Compare live SQLite schema to @table / collection declarations; non-destructive migrations. |
benchmark_telemetry | Benchmark observations stored in research_metrics (bench:<repository_id> sessions). |
build_hints | — |
capabilities | Turso / search tuning helpers (VOX_EMBEDDING_SEARCH_CANDIDATE_MULT, etc.). |
circuit_breaker | Circuit breaker for write operations. |
codex_chat | User chat, tool calls, usage limits, topics (manifest chat/search slices). |
connect_policy | Canonical connect policy helpers (strict vs optional degraded surfaces). |
history_store | — |
legacy | Explicit namespace for migration-era and cutover-only pathways. |
redact | — |
research_metrics_contract | Ludus / extended gamify_* contracts and metrics keys (DDL in baseline schema/domains). |
schema | — |
schema_extensions | Idempotent schema extensions (FTS). |
store | Legacy import/export planning and verification for greenfield Codex releases. |
telemetry_sink | — |
canonical_store | Canonical Codex storage policy (vox.db vs project store vs training sidecar). |
codex_legacy | — |
codex_schema | Manifest-derived readiness (baseline digest, required tables). |
collection | — |
data_flow | — |
ddl | — |
error_enrichment | — |
exec_time_telemetry | — |
sql_util | — |
learning | — |
legacy_import_extras | — |
memory | Parameters for [VoxDb::store_memory]. Alias of [crate::store::SaveMemoryParams] so application code can depend on vox-db only. |
migration | Declarative SQL migrations using the schema_version table (see crate::schema). |
normalize | SQL normalization and content-addressable hashing. |
writer_actor | Data directory and per-user id helpers (delegates to vox_config). |
paths | — |
pool | — |
outcome_recorder | — |
populi_control_telemetry | Mens control-plane audit (populi_control_event in research_metrics). |
populi_registry_telemetry | Opt-in mens local-registry publish rows (VOX_MESH_CODEX_TELEMETRY). |
preferences | Registry-scoped user preferences (stored as JSON in the local config directory). |
project_store | — |
research_doc_io | — |
research_pipeline | — |
schema_digest | AST → [crate::SchemaDigest] for LLM context and codegen. |
secrets | OS keyring helpers for API tokens and similar secrets. |
syntax_k_telemetry | — |
temporal_claims | — |
toestub_store | — |
training_run | Mens QLoRA training run persistence (CRUD for populi_training_run table). |
trials | Research Trial Tier-A atomic persistence (STORE-01, STORE-02). |
types | — |
workflow_journal | Interpreted workflow journal (workflow_journal_entry in research_metrics). |
workspace_journey_store | Workspace journey store resolution (.vox/store.db vs canonical) for repo-backed MCP/daemon flows. |
mesh_exec_leases | — |
mesh_locks | — |
oratio_eval | — |
plugin_state_backend | — |
web_cache | Content-addressed local web cache with HTTP 304 support. |
facade | — |
Structs
Section titled “Structs”| Struct | Description |
|---|---|
VoxDb | High-level database facade for the Vox ecosystem (Codex). Owns a single [VoxDb] (one Turso connection). Higher-level helpers (memory, learner, schema sync) delegate to that store; advanced callers use [Self::store] for direct access. Concurrency: one connection per VoxDb handle; Sync/safe across concurrent callers because [GuardedConnection] serializes access to the shared turso::Connection (see its docs for why this is required even though VoxDb/Connection are Clone). |
GuardedConnection | Serializes access to a shared turso::Connection to avoid turso::Error::Misuse("concurrent use forbidden"). ## Root cause this fixes turso::Connection::clone() does not create an independent connection: it clones an Arc to the same underlying turso_sdk_kit::rsapi::TursoConnection, which itself guards every step() (the primitive under query/execute/execute_batch/prepare) with an atomic ConcurrentGuard. Two async tasks that call into any clones of the same connection at literally the same instant (e.g. two Tauri GUI commands dispatched close together on a multi-threaded Tokio runtime, or a background poll racing a user action) can have their step() polls genuinely overlap on different OS threads, tripping that guard and returning Err(Misuse("concurrent use forbidden")). Since VoxDb is Clone and is shared as one Arc<VoxDb> across all GUI commands (see vox-gui/src/commands/gui_db_pool.rs), this happened routinely under ordinary concurrent chat usage, and the resulting error surfaced to users as a “Message not saved” toast — the write silently never reached the database. ## Fix Hold a tokio::sync::Mutex<()> around each real network/IO-bearing call (query/execute/execute_batch/pragma_update) before delegating to the wrapped turso::Connection. The lock lives behind an Arc so every clone of a GuardedConnection (and every clone of the owning VoxDb) shares the same lock — matching the fact that they already share the same underlying Turso connection. Implements [std::ops::Deref] to turso::Connection so call sites that need a raw &turso::Connection (e.g. [crate::auto_migrate::AutoMigrator::new], schema migrations run once at connect time) keep compiling unchanged via deref coercion. Method resolution prefers inherent methods on GuardedConnection over ones reached through Deref, so the ~400 existing call sites across this crate (and the many downstream crates that call VoxDb::connection(), e.g. vox-gamify, vox-populi, vox-sql, generated vox-codegen output) that do conn.query(..) / conn.execute(..) / conn.execute_batch(..) get the lock automatically without any call-site changes. ## Known residual gap turso::Connection::last_insert_rowid() is a synchronous, non-blocking read of connection-local state and does not go through ConcurrentGuard at all (confirmed by reading turso-0.6.1’s source), so it is intentionally left un-guarded here — wrapping it would require holding the lock across the execute + last_insert_rowid pair (a call-site change) rather than per-call. Callers that do this pairing (e.g. codex_chat.rs::chat_ensure_workspace_conversation) are not actually safe from this crate’s concurrency bug class: on the multi-threaded Tokio runtime this crate runs under, a different task on a different OS thread can execute its own guarded execute() (acquiring and releasing the lock) between this caller’s execute() and its last_insert_rowid() read, since nothing holds the lock across that gap — no explicit .await yield is required for that interleaving. This does not reproduce the Misuse("concurrent use forbidden") bug this type fixes (the two individual calls are each correctly guarded), but it can silently return the other task’s row id. It is noted here as a narrower, pre-existing (not introduced by this change) correctness edge case for future hardening (e.g. INSERT ... RETURNING). |
GuardedRows | Rows fully drained from [GuardedConnection::query] while its mutex guard was held, so nothing about iterating this value can race (or deadlock against) another guarded call on the same [GuardedConnection] — see the guard-lifetime note on query for why a lazy, still-locked cursor isn’t safe here. |
| Enum | Description |
|---|---|
ReadConsistency | Whether to pull embedded-replica updates before application-level reads. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
in_memory | Connect to an ephemeral in-memory database for testing. |
in_memory | Connect to an ephemeral in-memory database for testing. |
query | Guarded [turso::Connection::query]. Returns [GuardedRows] rather than a bare turso::Rows. The bare cursor is lazy, so a guard dropped when this function returns (before the caller reads a single row) would let row-streaming race other tasks’ execute/query on the same connection. Holding the guard on the returned value instead (rather than only inside this function) is not an option either: tokio::sync::Mutex isn’t reentrant, and this crate’s callers routinely do let mut rows = conn.query(...).await?; then, later in the same scope, another guarded call on conn (e.g. claim_skill_identity’s SELECT-then-INSERT) — rows would still be lexically alive at that point (Rust drops locals at end of scope, not at last use), so a guard tied to it would self-deadlock. Instead, drain every row into an owned buffer while still holding the guard, then release it before returning — the lock covers the entire real connection access and nothing outlives this function. |
execute | Guarded [turso::Connection::execute]. |
execute_batch | Guarded [turso::Connection::execute_batch]. |
pragma_update | Guarded [turso::Connection::pragma_update]. |
transaction | Execute an async closure inside a serialized SQLite BEGIN IMMEDIATE ... COMMIT transaction while holding the [GuardedConnection] mutex for the entire transaction lifetime. On any error returned by f, issues ROLLBACK before releasing the mutex. |
next | Mirrors [turso::Rows::next]‘s signature (async fn returning a Result) purely so existing rows.next().await? call sites keep compiling unchanged; the buffer is already fully materialized, so this never actually awaits or errors. |
| Type | Description |
|---|---|
MemoryParams | — |
Codex | Public product name for the unified database facade (Codex over Arca/Turso). VoxDb remains the stable Rust type name; new documentation should prefer Codex. |
Dependency Topology
Section titled “Dependency Topology”Diagram source
graph { direction: right node vox_db: "vox-db" node vox_ast: "vox-ast" vox_db -> vox_ast node vox_config: "vox-config" vox_db -> vox_config node vox_db_types: "vox-db-types" vox_db -> vox_db_types node vox_mesh_types: "vox-mesh-types" vox_db -> vox_mesh_types node vox_orchestrator_types: "vox-orchestrator-types" vox_db -> vox_orchestrator_types node vox_plugin_types: "vox-plugin-types" vox_db -> vox_plugin_types node vox_repository: "vox-repository" vox_db -> vox_repository node vox_secrets: "vox-secrets" vox_db -> vox_secrets node vox_telemetry: "vox-telemetry" vox_db -> vox_telemetry node vox_test_harness: "vox-test-harness" vox_db -> vox_test_harness node vox_actor_runtime: "vox-actor-runtime" vox_actor_runtime -> vox_db node vox_cli: "vox-cli" vox_cli -> vox_db node vox_cli_ci: "vox-cli-ci" vox_cli_ci -> vox_db node vox_cli_core: "vox-cli-core" vox_cli_core -> vox_db node vox_cli_research: "vox-cli-research" vox_cli_research -> vox_db node vox_cli_review: "vox-cli-review" vox_cli_review -> vox_db node vox_codegen: "vox-codegen" vox_codegen -> vox_db node vox_corpus: "vox-corpus" vox_corpus -> vox_db node vox_gamify: "vox-gamify" vox_gamify -> vox_db node vox_gui: "vox-gui" vox_gui -> vox_db node vox_ml_cli: "vox-ml-cli" vox_ml_cli -> vox_db node vox_openclaw_runtime: "vox-openclaw-runtime" vox_openclaw_runtime -> vox_db}Reverse Dependents (Used By)
Section titled “Reverse Dependents (Used By)”| Consumer Crate | Role |
|---|---|
vox-actor-runtime | Direct workspace dependent |
vox-cli | Direct workspace dependent |
vox-cli-ci | Direct workspace dependent |
vox-cli-core | Direct workspace dependent |
vox-cli-research | Direct workspace dependent |
vox-cli-review | Direct workspace dependent |
vox-codegen | Direct workspace dependent |
vox-corpus | Direct workspace dependent |
vox-gamify | Direct workspace dependent |
vox-gui | Direct workspace dependent |
vox-ml-cli | Direct workspace dependent |
vox-openclaw-runtime | Direct workspace dependent |
vox-orchestrator | Direct workspace dependent |
vox-orchestrator-d | Direct workspace dependent |
vox-orchestrator-mcp | Direct workspace dependent |
vox-orchestrator-models | Direct workspace dependent |
vox-orchestrator-queue | Direct workspace dependent |
vox-package | Direct workspace dependent |
vox-plugin-mens-candle-core | Direct workspace dependent |
vox-plugin-populi-mesh | Direct workspace dependent |
vox-plugin-publication | Direct workspace dependent |
vox-populi | Direct workspace dependent |
vox-publisher | Direct workspace dependent |
vox-research-shim | Direct workspace dependent |
vox-scientia | Direct workspace dependent |
vox-search | Direct workspace dependent |
vox-skills | Direct workspace dependent |
vox-sql | Direct workspace dependent |
vox-workflow-runtime | Direct workspace dependent |
Deep Public Symbols (Source-Anchored)
Section titled “Deep Public Symbols (Source-Anchored)”| Kind | Symbol | Signature | Source | Description |
|---|---|---|---|---|
type | MemoryParams | pub type MemoryParams<'a> = crate::store::SaveMemoryParams<'a> | crates/vox-db/src/lib.rs#L120 | — |
type | Codex | pub type Codex = VoxDb | crates/vox-db/src/lib.rs#L299 | Public product name for the unified database facade (Codex over Arca/Turso). VoxDb remains the stable Rust type name; new documentation should prefer Codex. |
enum | ReadConsistency | pub enum ReadConsistency | crates/vox-db/src/lib.rs#L303-L308 | Whether to pull embedded-replica updates before application-level reads. |
struct | VoxDb | pub struct VoxDb | crates/vox-db/src/lib.rs#L319-L331 | High-level database facade for the Vox ecosystem (Codex). Owns a single [VoxDb] (one Turso connection). Higher-level helpers (memory, learner, schema sync) delegate to that store; advanced callers use [Self::store] for direct access. Concurrency: one connection per VoxDb handle; Sync/safe across concurrent callers because [GuardedConnection] serializes access to the shared turso::Connection (see its docs for why this is required even though VoxDb/Connection are Clone). |
fn | in_memory | pub async fn in_memory() -> Result<Self, StoreError> | crates/vox-db/src/lib.rs#L351-L353 | Connect to an ephemeral in-memory database for testing. |
fn | in_memory | pub async fn in_memory() -> Result<Self, StoreError> | crates/vox-db/src/lib.rs#L357-L361 | Connect to an ephemeral in-memory database for testing. |
struct | GuardedConnection | pub struct GuardedConnection | crates/vox-db/src/lib.rs#L415-L418 | Serializes access to a shared turso::Connection to avoid turso::Error::Misuse("concurrent use forbidden"). ## Root cause this fixes turso::Connection::clone() does not create an independent connection: it clones an Arc to the same underlying turso_sdk_kit::rsapi::TursoConnection, which itself guards every step() (the primitive under query/execute/execute_batch/prepare) with an atomic ConcurrentGuard. Two async tasks that call into any clones of the same connection at literally the same instant (e.g. two Tauri GUI commands dispatched close together on a multi-threaded Tokio runtime, or a background poll racing a user action) can have their step() polls genuinely overlap on different OS threads, tripping that guard and returning Err(Misuse("concurrent use forbidden")). Since VoxDb is Clone and is shared as one Arc<VoxDb> across all GUI commands (see vox-gui/src/commands/gui_db_pool.rs), this happened routinely under ordinary concurrent chat usage, and the resulting error surfaced to users as a “Message not saved” toast — the write silently never reached the database. ## Fix Hold a tokio::sync::Mutex<()> around each real network/IO-bearing call (query/execute/execute_batch/pragma_update) before delegating to the wrapped turso::Connection. The lock lives behind an Arc so every clone of a GuardedConnection (and every clone of the owning VoxDb) shares the same lock — matching the fact that they already share the same underlying Turso connection. Implements [std::ops::Deref] to turso::Connection so call sites that need a raw &turso::Connection (e.g. [crate::auto_migrate::AutoMigrator::new], schema migrations run once at connect time) keep compiling unchanged via deref coercion. Method resolution prefers inherent methods on GuardedConnection over ones reached through Deref, so the ~400 existing call sites across this crate (and the many downstream crates that call VoxDb::connection(), e.g. vox-gamify, vox-populi, vox-sql, generated vox-codegen output) that do conn.query(..) / conn.execute(..) / conn.execute_batch(..) get the lock automatically without any call-site changes. ## Known residual gap turso::Connection::last_insert_rowid() is a synchronous, non-blocking read of connection-local state and does not go through ConcurrentGuard at all (confirmed by reading turso-0.6.1’s source), so it is intentionally left un-guarded here — wrapping it would require holding the lock across the execute + last_insert_rowid pair (a call-site change) rather than per-call. Callers that do this pairing (e.g. codex_chat.rs::chat_ensure_workspace_conversation) are not actually safe from this crate’s concurrency bug class: on the multi-threaded Tokio runtime this crate runs under, a different task on a different OS thread can execute its own guarded execute() (acquiring and releasing the lock) between this caller’s execute() and its last_insert_rowid() read, since nothing holds the lock across that gap — no explicit .await yield is required for that interleaving. This does not reproduce the Misuse("concurrent use forbidden") bug this type fixes (the two individual calls are each correctly guarded), but it can silently return the other task’s row id. It is noted here as a narrower, pre-existing (not introduced by this change) correctness edge case for future hardening (e.g. INSERT ... RETURNING). |
fn | query | pub async fn query( | crates/vox-db/src/lib.rs#L442 | Guarded [turso::Connection::query]. Returns [GuardedRows] rather than a bare turso::Rows. The bare cursor is lazy, so a guard dropped when this function returns (before the caller reads a single row) would let row-streaming race other tasks’ execute/query on the same connection. Holding the guard on the returned value instead (rather than only inside this function) is not an option either: tokio::sync::Mutex isn’t reentrant, and this crate’s callers routinely do let mut rows = conn.query(...).await?; then, later in the same scope, another guarded call on conn (e.g. claim_skill_identity’s SELECT-then-INSERT) — rows would still be lexically alive at that point (Rust drops locals at end of scope, not at last use), so a guard tied to it would self-deadlock. Instead, drain every row into an owned buffer while still holding the guard, then release it before returning — the lock covers the entire real connection access and nothing outlives this function. |
fn | execute | pub async fn execute( | crates/vox-db/src/lib.rs#L460 | Guarded [turso::Connection::execute]. |
fn | execute_batch | pub async fn execute_batch(&self, sql: impl AsRef<str>) -> turso::Result<()> | crates/vox-db/src/lib.rs#L471-L474 | Guarded [turso::Connection::execute_batch]. |
fn | pragma_update | pub async fn pragma_update<V: std::fmt::Display>( | crates/vox-db/src/lib.rs#L478 | Guarded [turso::Connection::pragma_update]. |
fn | transaction | pub async fn transaction<'a, F, Fut, T>(&'a self, f: F) -> Result<T, crate::StoreError> | crates/vox-db/src/lib.rs#L490 | Execute an async closure inside a serialized SQLite BEGIN IMMEDIATE ... COMMIT transaction while holding the [GuardedConnection] mutex for the entire transaction lifetime. On any error returned by f, issues ROLLBACK before releasing the mutex. |
struct | GuardedRows | pub struct GuardedRows | crates/vox-db/src/lib.rs#L525-L527 | Rows fully drained from [GuardedConnection::query] while its mutex guard was held, so nothing about iterating this value can race (or deadlock against) another guarded call on the same [GuardedConnection] — see the guard-lifetime note on query for why a lazy, still-locked cursor isn’t safe here. |
fn | next | pub async fn next(&mut self) -> turso::Result<Option<turso::Row>> | crates/vox-db/src/lib.rs#L534-L536 | Mirrors [turso::Rows::next]‘s signature (async fn returning a Result) purely so existing rows.next().await? call sites keep compiling unchanged; the buffer is already fully materialized, so this never actually awaits or errors. |
struct | auto_migrate::LiveColumn | pub struct LiveColumn | crates/vox-db/src/auto_migrate.rs#L31-L42 | A column definition as read from PRAGMA table_info(...). |
struct | auto_migrate::LiveTable | pub struct LiveTable | crates/vox-db/src/auto_migrate.rs#L46-L51 | A table definition as introspected from the live database. |
enum | auto_migrate::MigrationAction | pub enum MigrationAction | crates/vox-db/src/auto_migrate.rs#L57-L96 | A single migration action to be applied. |
fn | auto_migrate::is_auto_safe | pub fn is_auto_safe(&self) -> bool | crates/vox-db/src/auto_migrate.rs#L100-L108 | Returns true if this action is safe to apply automatically. |
fn | auto_migrate::to_sql | pub fn to_sql(&self) -> Option<String> | crates/vox-db/src/auto_migrate.rs#L111-L127 | Generate SQL for this action. Returns None for manual-only actions. |
fn | auto_migrate::describe | pub fn describe(&self) -> String | crates/vox-db/src/auto_migrate.rs#L130-L149 | Human-readable description of this action. |
struct | auto_migrate::MigrationPlan | pub struct MigrationPlan | crates/vox-db/src/auto_migrate.rs#L154-L157 | Result of comparing live DB state to desired declarations. |
fn | auto_migrate::is_empty | pub fn is_empty(&self) -> bool | crates/vox-db/src/auto_migrate.rs#L161-L163 | Returns true if no changes are needed. |
fn | auto_migrate::auto_actions | pub fn auto_actions(&self) -> Vec<&MigrationAction> | crates/vox-db/src/auto_migrate.rs#L166-L168 | Actions that are safe to apply automatically. |
fn | auto_migrate::manual_actions | pub fn manual_actions(&self) -> Vec<&MigrationAction> | crates/vox-db/src/auto_migrate.rs#L171-L173 | Actions that require manual intervention. |
fn | auto_migrate::describe | pub fn describe(&self) -> String | crates/vox-db/src/auto_migrate.rs#L176-L190 | Generate a human-readable summary of the migration plan. |
struct | auto_migrate::AutoMigrator | pub struct AutoMigrator<'a> | crates/vox-db/src/auto_migrate.rs#L194-L196 | Compares AST-backed declarations to PRAGMA/sqlite_master state. |
fn | auto_migrate::new | pub fn new(conn: &'a Connection) -> Self | crates/vox-db/src/auto_migrate.rs#L202-L204 | Create an engine bound to one Turso connection (typically from VoxDb / VoxDb). |
fn | auto_migrate::introspect_tables | pub async fn introspect_tables(&self) -> Result<Vec<LiveTable>, turso::Error> | crates/vox-db/src/auto_migrate.rs#L207-L249 | Introspect the live database to get all user tables. |
fn | auto_migrate::plan | pub async fn plan( | crates/vox-db/src/auto_migrate.rs#L252 | Compute the migration plan by diffing live schema against desired tables. |
fn | auto_migrate::plan_from_digest | pub async fn plan_from_digest( | crates/vox-db/src/auto_migrate.rs#L268 | Like [Self::plan], but desired shape comes from a [SchemaDigest] (e.g. from codegen/LLM). Standard indexes from the digest are emitted; vector/search indexes are skipped here. |
fn | auto_migrate::apply | pub async fn apply(&self, plan: &MigrationPlan) -> Result<usize, turso::Error> | crates/vox-db/src/auto_migrate.rs#L433-L442 | Apply all safe migration actions. Returns the number of actions applied. |
fn | auto_migrate::sync_schema | pub async fn sync_schema( | crates/vox-db/src/auto_migrate.rs#L445 | Plan and apply auto-safe migrations in one call. |
fn | auto_migrate::sync_from_digest | pub async fn sync_from_digest( | crates/vox-db/src/auto_migrate.rs#L457 | [Self::plan_from_digest] followed by [Self::apply] for auto-safe actions only. |
struct | benchmark_telemetry::BenchmarkEventMeta | pub struct BenchmarkEventMeta | crates/vox-db/src/benchmark_telemetry.rs#L14-L26 | Payload for one benchmark observation. |
fn | benchmark_telemetry::record_benchmark_event | pub async fn record_benchmark_event( | crates/vox-db/src/benchmark_telemetry.rs#L30 | Append one benchmark row to research_metrics under bench:<repository_id>. |
struct | build_hints::BuildHint | pub struct BuildHint | crates/vox-db/src/build_hints.rs#L8-L15 | One entry in the static hint table. |
fn | build_hints::lookup_hint | pub fn lookup_hint(crate_name: &str, warning_code: Option<&str>) -> Option<&'static str> | crates/vox-db/src/build_hints.rs#L80-L101 | Return the first matching suggestion for a crate + optional warning code. Returns None when no pattern matches. |
fn | canonical_store::resolve_canonical_config | pub fn resolve_canonical_config() -> Result<DbConfig, String> | crates/vox-db/src/canonical_store.rs#L27-L29 | Resolves the canonical user-global [DbConfig] for Codex / VoxDB. Alias for [DbConfig::resolve_canonical]; use either name for clarity at callsites. |
fn | canonical_store::user_global_sqlite_path | pub fn user_global_sqlite_path() -> Option<PathBuf> | crates/vox-db/src/canonical_store.rs#L33-L35 | Default local path to vox.db when the platform data dir is known (VOX_DATA_DIR / defaults). |
struct | capabilities::SqliteProbeSnapshot | pub struct SqliteProbeSnapshot | crates/vox-db/src/capabilities.rs#L11-L18 | Observed libSQL/SQLite behavior for strategy selection (best-effort; never panics on parse). |
fn | capabilities::probe_sqlite_capabilities | pub async fn probe_sqlite_capabilities( | crates/vox-db/src/capabilities.rs#L21 | Run lightweight PRAGMA probes on an open connection (safe for repeated calls). |
fn | capabilities::embedding_candidate_cap | pub fn embedding_candidate_cap( | crates/vox-db/src/capabilities.rs#L64 | Rows to scan before ranking = limit * multiplier, capped. Override with VOX_EMBEDDING_SEARCH_CANDIDATE_MULT (integer ≥ 1). Default multiplier is passed by the caller (e.g. 10 for search_similar_embeddings). When probe reports fts5_reported == false, the effective multiplier is boosted (capped) so brute-force embedding recall stays competitive on builds without FTS5 in compile options. |
enum | circuit_breaker::CircuitBreakerError | pub enum CircuitBreakerError | crates/vox-db/src/circuit_breaker.rs#L43-L47 | Error emitted when the circuit is open. |
struct | circuit_breaker::DbCircuitBreaker | pub struct DbCircuitBreaker | crates/vox-db/src/circuit_breaker.rs#L60-L67 | Thread-safe circuit breaker for database write paths. Enabled only when VOX_DB_CIRCUIT_BREAKER=1 in the environment. When disabled, [DbCircuitBreaker::call] always executes the action. |
fn | circuit_breaker::enabled_from_env | pub fn enabled_from_env() -> bool | crates/vox-db/src/circuit_breaker.rs#L78-L85 | Returns true when VOX_DB_CIRCUIT_BREAKER=1 (or true). Inlined rather than calling vox_config::db_circuit_breaker_env_enabled() (mirrors that function exactly): this crate’s vox-config dependency is optional behind the host-integration feature, and the circuit breaker is used by non-host-integration consumers (e.g. vox-orchestrator) that still need to read this one env var. |