Expand description
§Phase 0: Storage Bridge — Wiring SQL Execution to Real Storage
This module provides concrete implementations of the query layer’s
StorageBackend and SqlConnection traits, backed by the actual
sochdb_storage::Database kernel.
§Architecture
┌─────────────────────────────────────────────────┐
│ Query Layer (sochdb-query) │
│ │
│ ┌──────────────┐ ┌───────────────────────┐ │
│ │ OptimizedExec │ │ SQL AST (SqlBridge) │ │
│ └──────┬───────┘ └───────────┬───────────┘ │
│ │ │ │
│ ┌──────▼────────────────────────▼───────────┐ │
│ │ StorageBackend trait │ │
│ │ SqlConnection trait │ │
│ └──────────────────┬────────────────────────┘ │
├─────────────────────┼────────────────────────────┤
│ ┌───────────▼───────────────┐ │
│ │ DatabaseStorageBackend │ │
│ │ DatabaseSqlConnection │ │
│ └───────────┬───────────────┘ │
├─────────────────────┼────────────────────────────┤
│ Storage Layer (sochdb-storage) │
│ ┌───────────▼───────────┐ │
│ │ Database kernel │ │
│ │ (DurableStorage + │ │
│ │ MVCC + WAL) │ │
│ └───────────────────────┘ │
└─────────────────────────────────────────────────┘§SochValue Bridging
The storage layer uses sochdb_core::SochValue (10 variants including
Object and Ref), while the query optimizer uses
sochdb_query::soch_ql::SochValue (8 variants, missing Object/Ref).
This module provides convert_core_to_query() to bridge the gap:
Object(map)→ serialized asText(json_string)Ref { table, id }→Text("table/id")
Structs§
- Database
SqlConnection - Concrete implementation of
SqlConnectionbacked bysochdb_storage::Database. - Database
Storage Backend - Concrete implementation of
StorageBackendbacked bysochdb_storage::Database. - Namespaced
SqlConnection - A wrapper around any
SqlConnectionthat prefixes table names withnamespace:database:to provide storage-level isolation between tenants.
Functions§
- convert_
core_ to_ query - Convert
sochdb_core::SochValuetosochdb_query::soch_ql::SochValue. - convert_
query_ to_ core - Convert
sochdb_query::soch_ql::SochValuetosochdb_core::SochValue.