Skip to main content

reddb_server/
lib.rs

1#![allow(dead_code, unused_imports, unused_variables)]
2// Structural lints we accept for API design reasons:
3#![allow(
4    clippy::too_many_arguments,   // complex DB operations legitimately need many params
5    clippy::type_complexity,      // internal types with nested generics
6    clippy::result_large_err,     // tonic::Status is 176 bytes, can't box it
7    clippy::should_implement_trait, // from_str() returns Option, not Result — different semantics
8    clippy::new_without_default,  // some constructors have side effects
9    clippy::enum_variant_names,   // JoinPhase variants all end in Start by design
10    clippy::wrong_self_convention, // to_bytes on Copy types in our serialization
11    clippy::len_without_is_empty  // segment structs don't need is_empty
12)]
13
14pub mod ai;
15pub mod api;
16pub mod application;
17pub mod auth;
18pub mod backup_bootstrap;
19pub mod catalog;
20pub mod cli;
21pub mod cluster;
22pub mod config;
23pub mod crypto;
24pub mod ec;
25pub mod engine;
26pub mod geo;
27pub mod grpc;
28pub mod health;
29pub mod index;
30pub mod json;
31pub mod json_field;
32pub mod log;
33pub mod mcp;
34pub mod modules;
35pub mod notifications;
36pub mod physical;
37pub(crate) mod presentation;
38pub mod regress;
39pub mod replication;
40pub(crate) mod reserved_fields;
41pub mod rpc_stdio;
42pub mod runtime;
43pub mod serde_json;
44pub mod server;
45pub mod service_cli;
46mod service_router;
47pub mod sqlstate;
48pub mod storage;
49pub mod streams;
50pub mod telemetry;
51pub mod utils;
52pub mod wire;
53
54/// Re-export of the shared `reddb-wire` crate.
55///
56/// `reddb-wire` is the transport-agnostic protocol vocabulary
57/// (connection-string parser today, RedWire frames in a follow-up
58/// slice). Exposed here so existing `use reddb::…` callers can
59/// reach the parser without a separate dependency.
60pub use reddb_wire as wire_proto;
61
62pub mod prelude {
63    pub use crate::api::{
64        Capability, CapabilitySet, CatalogService, CatalogSnapshot, CollectionStats, DataOps,
65        QueryPlanner, RedDBError, RedDBOptions, RedDBResult, SchemaManifest, StorageMode,
66        DEFAULT_EXPORT_RETENTION, DEFAULT_SNAPSHOT_RETENTION, REDDB_FORMAT_VERSION,
67        REDDB_PROTOCOL_VERSION,
68    };
69    pub use crate::application::{
70        AdminUseCases, CatalogUseCases, EntityUseCases, GraphUseCases, NativeUseCases,
71        QueryUseCases, RuntimeAdminPort, RuntimeCatalogPort, RuntimeEntityPort, RuntimeGraphPort,
72        RuntimeNativePort, RuntimeQueryPort, RuntimeSchemaPort, SchemaUseCases,
73    };
74    pub use crate::auth::store::AuthStore;
75    pub use crate::auth::{AuthConfig, AuthError, Role as AuthRole};
76    pub use crate::catalog::{
77        snapshot_store, CatalogModelSnapshot, CollectionDescriptor, CollectionModel, SchemaMode,
78    };
79    pub use crate::engine::{EngineInfo, EngineStats, RedDBEngine};
80    pub use crate::grpc::{GrpcServerOptions, GrpcTlsOptions, RedDBGrpcServer};
81    pub use crate::health::{HealthIssue, HealthProvider, HealthReport, HealthState};
82    pub use crate::index::{
83        IndexCatalog, IndexCatalogSnapshot, IndexConfig, IndexKind, IndexMetric, IndexRuntime,
84        IndexStats,
85    };
86    pub use crate::physical::{
87        ArtifactState, BlockReference, CompactionPolicy, ExportDescriptor, GridLayout,
88        ManifestEvent, ManifestEventKind, ManifestPointers, PhysicalAnalyticsJob,
89        PhysicalGraphProjection, PhysicalIndexState, PhysicalLayout, PhysicalMetadataFile,
90        SnapshotDescriptor, SuperblockHeader, WalPolicy, DEFAULT_MANIFEST_EVENT_HISTORY,
91        PHYSICAL_METADATA_PROTOCOL_VERSION,
92    };
93    pub use crate::runtime::{
94        ConnectionPoolConfig, RedDBRuntime, RuntimeConnection, RuntimeFilter, RuntimeFilterValue,
95        RuntimeGraphCentralityAlgorithm, RuntimeGraphCentralityResult, RuntimeGraphCentralityScore,
96        RuntimeGraphClusteringResult, RuntimeGraphCommunity, RuntimeGraphCommunityAlgorithm,
97        RuntimeGraphCommunityResult, RuntimeGraphComponent, RuntimeGraphComponentsMode,
98        RuntimeGraphComponentsResult, RuntimeGraphCyclesResult, RuntimeGraphDegreeScore,
99        RuntimeGraphDirection, RuntimeGraphEdge, RuntimeGraphHitsResult,
100        RuntimeGraphNeighborhoodResult, RuntimeGraphNode, RuntimeGraphPath,
101        RuntimeGraphPathAlgorithm, RuntimeGraphPathResult, RuntimeGraphPattern,
102        RuntimeGraphProjection, RuntimeGraphTopologicalSortResult, RuntimeGraphTraversalResult,
103        RuntimeGraphTraversalStrategy, RuntimeGraphVisit, RuntimeIvfMatch, RuntimeIvfSearchResult,
104        RuntimeQueryResult, RuntimeQueryWeights, RuntimeStats, ScanCursor, ScanPage,
105    };
106    pub use crate::server::{RedDBServer, ServerOptions, ServerReplicationState};
107}
108
109pub use crate::api::{
110    tier_wiring, Capability, CapabilitySet, CatalogService, CatalogSnapshot, CollectionStats,
111    DataOps, QueryPlanner, RedDBError, RedDBOptions, RedDBResult, SchemaManifest, StorageMode,
112    DEFAULT_EXPORT_RETENTION, DEFAULT_SNAPSHOT_RETENTION, REDDB_FORMAT_VERSION,
113    REDDB_PROTOCOL_VERSION,
114};
115pub use crate::application::{
116    AdminUseCases, CatalogUseCases, EntityUseCases, GraphUseCases, NativeUseCases, QueryUseCases,
117    RuntimeAdminPort, RuntimeCatalogPort, RuntimeEntityPort, RuntimeGraphPort, RuntimeNativePort,
118    RuntimeQueryPort, RuntimeSchemaPort, SchemaUseCases,
119};
120pub use crate::catalog::{
121    snapshot_store, CatalogModelSnapshot, CollectionDescriptor, CollectionModel, SchemaMode,
122};
123pub use crate::engine::{EngineInfo, EngineStats, RedDBEngine};
124pub use crate::grpc::{GrpcServerOptions, GrpcTlsOptions, RedDBGrpcServer};
125pub use crate::health::{HealthIssue, HealthProvider, HealthReport, HealthState};
126pub use crate::index::{
127    IndexCatalog, IndexCatalogSnapshot, IndexConfig, IndexKind, IndexMetric, IndexRuntime,
128    IndexStats,
129};
130pub use crate::physical::{
131    fold_dwb_into_wal_enabled, fold_pager_meta_enabled, meta_json_sidecar_enabled, provision_shm,
132    read_shm_header, seqn_journal_enabled, seqn_journal_retention, set_fold_dwb_into_wal_enabled,
133    set_fold_pager_meta_enabled, set_meta_json_sidecar_enabled, set_seqn_journal_enabled,
134    set_seqn_journal_retention, set_shm_provisioning_enabled, shm_path_for,
135    shm_provisioning_enabled, ArtifactState, BlockReference, CompactionPolicy, ExportDescriptor,
136    GridLayout, ManifestEvent, ManifestEventKind, ManifestPointers, PhysicalAnalyticsJob,
137    PhysicalGraphProjection, PhysicalIndexState, PhysicalLayout, PhysicalMetadataFile, ShmHandle,
138    ShmHeader, ShmProvisionState, SnapshotDescriptor, SuperblockHeader, WalPolicy,
139    DEFAULT_MANIFEST_EVENT_HISTORY, DEFAULT_METADATA_JOURNAL_RETENTION,
140    OPT_IN_METADATA_JOURNAL_RETENTION, PHYSICAL_METADATA_PROTOCOL_VERSION, SHM_FILE_SIZE,
141    SHM_HEADER_SIZE, SHM_MAGIC, SHM_VERSION,
142};
143pub use crate::replication::{ReplicationConfig, ReplicationRole};
144pub use crate::runtime::{
145    ConnectionPoolConfig, RedDBRuntime, RuntimeConnection, RuntimeFilter, RuntimeFilterValue,
146    RuntimeGraphCentralityAlgorithm, RuntimeGraphCentralityResult, RuntimeGraphCentralityScore,
147    RuntimeGraphClusteringResult, RuntimeGraphCommunity, RuntimeGraphCommunityAlgorithm,
148    RuntimeGraphCommunityResult, RuntimeGraphComponent, RuntimeGraphComponentsMode,
149    RuntimeGraphComponentsResult, RuntimeGraphCyclesResult, RuntimeGraphDegreeScore,
150    RuntimeGraphDirection, RuntimeGraphEdge, RuntimeGraphHitsResult,
151    RuntimeGraphNeighborhoodResult, RuntimeGraphNode, RuntimeGraphPath, RuntimeGraphPathAlgorithm,
152    RuntimeGraphPathResult, RuntimeGraphPattern, RuntimeGraphProjection,
153    RuntimeGraphTopologicalSortResult, RuntimeGraphTraversalResult, RuntimeGraphTraversalStrategy,
154    RuntimeGraphVisit, RuntimeIvfMatch, RuntimeIvfSearchResult, RuntimeQueryResult,
155    RuntimeQueryWeights, RuntimeStats, ScanCursor, ScanPage,
156};
157pub use crate::server::{RedDBServer, ServerOptions, ServerReplicationState};
158
159pub use crate::storage::*;