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// Machine Learning registry + async job queue (ML Sprint 1 — scaffold).
54// Feature 5 (classifier), Feature 6 (symbolic regression), and the other
55// five ML capabilities all publish models/versions and submit training
56// jobs through this module.
57pub mod ml;
58
59// Query Engine (Filters, Sorting, Similarity Search)
60pub mod query;
61
62// Unified Storage Layer (Tables + Graphs + Vectors)
63pub(crate) mod unified;
64
65// Per-collection disk usage accounting for runtime catalog views.
66pub(crate) mod disk_accountant;
67
68// Public surface re-used by the rest of the codebase.
69pub use backend::{BackendError, LocalBackend, RemoteBackend};
70pub use keyring::{
71 clear_keyring, has_keyring_password, resolve_password, save_to_keyring, PasswordSource,
72};
73pub use unified::RedDB;
74
75// =============================================================================
76// UNIFIED STORAGE INTERFACE (PRIMARY API)
77// =============================================================================
78//
79// The unified storage layer is THE primary interface for all storage operations.
80// Use `storage::Store` and `storage::Query` for all new code.
81//
82// Use `storage::Store` and `storage::Query` for all new code.
83
84pub use unified::{
85 AdjacencyEntry,
86 CrossRef,
87 DslFilter,
88 DslQueryResult as QueryResult,
89 EdgeData,
90 EdgeDirection,
91 EmbeddingSlot,
92 EntityData,
93 // Entity types - Universal data model
94 EntityId,
95 EntityKind,
96 FilterOp,
97 FilterValue,
98 // Graph adjacency index
99 GraphAdjacencyIndex,
100 GraphQueryBuilder,
101 HybridQueryBuilder,
102 IndexEvent,
103 IndexEventKind,
104
105 IndexStats,
106 IndexStatus,
107 // Index lifecycle management
108 IndexType,
109 IntegratedIndexConfig as IndexConfig,
110 IntegratedIndexConfig,
111
112 // Index Manager - Unified indexing (HNSW + Inverted + B-tree + Graph)
113 IntegratedIndexManager as IndexManager,
114 IntegratedIndexManager,
115 InvertedIndex,
116 LifecycleEvent,
117
118 ManagerConfig,
119 ManagerStats,
120 MatchComponents,
121
122 // Metadata
123 Metadata,
124 MetadataQueryFilter,
125 MetadataStorage,
126 MetadataType,
127
128 MetadataValue,
129 // =========================================================================
130 // PRIMARY INTERFACE - Use these for all new code
131 // =========================================================================
132 NativeHeaderRepairPolicy,
133 NodeData,
134 QueryResultItem,
135 RefQueryBuilder,
136 RefType,
137
138 RowData,
139 ScanQueryBuilder,
140 ScoredMatch,
141 SegmentConfig as UnifiedSegmentConfig,
142 SegmentError,
143
144 SegmentId as UnifiedSegmentId,
145 // Manager
146 SegmentManager,
147 SegmentState,
148 SegmentStats,
149 SimilarResult,
150 SortOrder,
151 SparseVector,
152 StoreError,
153
154 StoreStats,
155 TableQueryBuilder,
156 TextSearchBuilder,
157 TextSearchResult,
158 TimeSeriesData,
159 TimeSeriesPointKind,
160 TraversalDirection,
161 UnifiedEntity,
162 UnifiedEntity as Entity,
163 UnifiedMetadataFilter,
164 // Segments
165 UnifiedSegment,
166 // Store - THE primary storage interface
167 UnifiedStore,
168 UnifiedStore as Store,
169 UnifiedStoreConfig,
170 VectorData,
171 // Query builders (for advanced use)
172 VectorQueryBuilder,
173 VectorSearchResult,
174 WhereClause,
175 // Query DSL - Entry point for all queries
176 Q as Query,
177};