Skip to main content

reddb_server/storage/
mod.rs

1// reddb persistent storage core
2//
3// This module exposes the unified RedDB storage engine for tables, documents,
4// graphs, and vectors with a single API surface.
5
6// Low-level primitives (bloom filters, encoding, mmap, serialization)
7pub mod primitives;
8
9// Cross-structure index abstraction (trait + bloom segment helper)
10pub mod index;
11
12// RedDB Storage Engine (page-based, B-tree indexed)
13pub mod engine;
14
15// B+ Tree with MVCC (Concurrent Storage)
16pub mod btree;
17
18// Transaction Management (ACID)
19pub mod transaction;
20
21// Page Cache (SIEVE Algorithm)
22pub mod cache;
23
24// Foreign Data Wrappers (Phase 3.2 PG parity)
25pub mod fdw;
26
27// SQLite Import/Compatibility Layer
28pub mod import;
29
30// Write-ahead log - serializer is now integrated into storage primitives
31
32// Write-Ahead Log (Durability)
33pub mod wal;
34
35// Encryption Layer (Security)
36pub mod encryption;
37
38// Remote Storage Backend Abstraction (S3, R2, GCS, Turso, D1)
39pub mod backend;
40
41// Keyring integration for secure password storage
42pub mod keyring;
43
44// Schema System (Types, Tables, Registry)
45pub mod schema;
46
47// Time-Series Storage
48pub mod timeseries;
49
50// Queue / Deque Storage
51pub mod queue;
52
53// Vector storage stable contract surface (introspection, etc.) — issue #743.
54pub mod vector;
55
56// Graph storage stable contract surface (viewport, etc.) — issue #744.
57pub mod graph;
58
59// Machine Learning registry + async job queue (ML Sprint 1 — scaffold).
60// Feature 5 (classifier), Feature 6 (symbolic regression), and the other
61// five ML capabilities all publish models/versions and submit training
62// jobs through this module.
63pub mod ml;
64
65// Query Engine (Filters, Sorting, Similarity Search)
66pub mod query;
67
68// Unified Storage Layer (Tables + Graphs + Vectors)
69pub(crate) mod unified;
70
71// Per-collection disk usage accounting for runtime catalog views.
72pub(crate) mod disk_accountant;
73
74// Pure tiered storage layout derivation.
75pub mod layout;
76
77// Blockchain collection kind: pure logic for hash-chained append-only rows.
78// Storage/wire integration tracked in issue #521.
79pub mod blockchain;
80
81// Signed Writes: ed25519 signer registry + insert verification logic
82// for `CREATE COLLECTION ... SIGNED_BY (...)` (issues #520, #522).
83// Runtime wiring (insert path, reserved-column injection, REST error
84// codes) lands in follow-up slices; this module ships the pure
85// primitives the wiring will call into.
86pub mod signed_writes;
87
88// Public surface re-used by the rest of the codebase.
89pub use backend::{BackendError, LocalBackend, RemoteBackend};
90pub use keyring::{
91    clear_keyring, has_keyring_password, resolve_password, save_to_keyring, PasswordSource,
92};
93pub use layout::{
94    LayoutOverrides, LayoutToggles, LogDestination, LogRoutingOverrides, StorageLayout,
95    TieredLayoutPaths,
96};
97pub use unified::RedDB;
98
99// =============================================================================
100// UNIFIED STORAGE INTERFACE (PRIMARY API)
101// =============================================================================
102//
103// The unified storage layer is THE primary interface for all storage operations.
104// Use `storage::Store` and `storage::Query` for all new code.
105//
106// Use `storage::Store` and `storage::Query` for all new code.
107
108pub use unified::{
109    AdjacencyEntry,
110    CrossRef,
111    DslFilter,
112    DslQueryResult as QueryResult,
113    EdgeData,
114    EdgeDirection,
115    EmbeddingSlot,
116    EntityData,
117    // Entity types - Universal data model
118    EntityId,
119    EntityKind,
120    FilterOp,
121    FilterValue,
122    // Graph adjacency index
123    GraphAdjacencyIndex,
124    GraphQueryBuilder,
125    HybridQueryBuilder,
126    IndexEvent,
127    IndexEventKind,
128
129    IndexStats,
130    IndexStatus,
131    // Index lifecycle management
132    IndexType,
133    IntegratedIndexConfig as IndexConfig,
134    IntegratedIndexConfig,
135
136    // Index Manager - Unified indexing (HNSW + Inverted + B-tree + Graph)
137    IntegratedIndexManager as IndexManager,
138    IntegratedIndexManager,
139    InvertedIndex,
140    LifecycleEvent,
141
142    ManagerConfig,
143    ManagerStats,
144    MatchComponents,
145
146    // Metadata
147    Metadata,
148    MetadataQueryFilter,
149    MetadataStorage,
150    MetadataType,
151
152    MetadataValue,
153    // =========================================================================
154    // PRIMARY INTERFACE - Use these for all new code
155    // =========================================================================
156    NativeHeaderRepairPolicy,
157    NodeData,
158    QueryResultItem,
159    RefQueryBuilder,
160    RefType,
161
162    RowData,
163    ScanQueryBuilder,
164    ScoredMatch,
165    SegmentConfig as UnifiedSegmentConfig,
166    SegmentError,
167
168    SegmentId as UnifiedSegmentId,
169    // Manager
170    SegmentManager,
171    SegmentState,
172    SegmentStats,
173    SimilarResult,
174    SortOrder,
175    SparseVector,
176    StoreError,
177
178    StoreStats,
179    TableQueryBuilder,
180    TextSearchBuilder,
181    TextSearchResult,
182    TimeSeriesData,
183    TimeSeriesPointKind,
184    TraversalDirection,
185    UnifiedEntity,
186    UnifiedEntity as Entity,
187    UnifiedMetadataFilter,
188    // Segments
189    UnifiedSegment,
190    // Store - THE primary storage interface
191    UnifiedStore,
192    UnifiedStore as Store,
193    UnifiedStoreConfig,
194    VectorData,
195    // Query builders (for advanced use)
196    VectorQueryBuilder,
197    VectorSearchResult,
198    WhereClause,
199    // Query DSL - Entry point for all queries
200    Q as Query,
201};