Skip to main content

mongreldb_core/
lib.rs

1//! MongrelDB core — a log-structured columnar store with sub-ms writes, learned
2//! indexes over a shared row-id space, page-level native encryption, an
3//! MVCC-tagged content-addressed cache, and an AI-native access layer.
4//!
5//! The crate owns the WAL + memtable + Bε-tree write path, sorted-run container
6//! formats, MVCC snapshots, page cache, encryption, compaction, and indexes.
7
8#![allow(clippy::module_inception)]
9#![recursion_limit = "2048"]
10
11pub mod auth;
12pub mod auth_state;
13pub mod backup;
14pub mod be_tree;
15pub mod cache;
16pub mod catalog;
17pub mod columnar;
18pub mod compaction;
19pub mod constraint;
20pub mod cursor;
21pub mod database;
22pub mod encryption;
23pub mod engine;
24pub mod epoch;
25pub mod error;
26pub mod external_table;
27pub mod gc;
28pub mod global_idx;
29pub mod index;
30pub mod manifest;
31pub mod memtable;
32pub mod mutable_run;
33pub mod page;
34pub mod pitr;
35pub mod pma;
36pub mod procedure;
37pub mod query;
38pub mod replication;
39pub mod reservoir;
40pub mod retention;
41pub(crate) mod row_id_set;
42pub mod rowid;
43pub mod schema;
44pub mod security;
45pub mod sorted_run;
46pub mod trace;
47pub mod trigger;
48pub mod tsv;
49pub mod txn;
50pub mod wal;
51
52pub use auth::{
53    hash_password, verify_password, ColumnAccess, ColumnOperation, Permission, Principal,
54    RoleEntry, UserEntry,
55};
56pub use backup::{verify_backup, BackupFile, BackupManifest, BackupReport};
57pub use be_tree::BeTree;
58pub use cache::PageCache;
59pub use catalog::{
60    IncrementalAggregateKind, IncrementalAggregateOutput, IncrementalAggregateView,
61    MaterializedViewEntry,
62};
63pub use columnar::{decode_column, encode_column};
64pub use cursor::{drain_cursor_to_columns, Cursor, MultiRunCursor, NativePageCursor};
65pub use database::{
66    lock_table_with_context, AuthorizedReadSnapshot, CdcBatch, ChangeEvent, CheckIssue, Database,
67    ExternalTriggerBaseWrite, ExternalTriggerBridge, ExternalTriggerWrite,
68    ExternalTriggerWriteResult, OpenOptions, ReadAuthorization, TableGuard, TableHandle,
69};
70pub use encryption::{Cipher, PlaintextCipher};
71pub use engine::{
72    AggState, ApproxAgg, ApproxResult, CachedAgg, ColumnStat, IncrementalAggResult,
73    IndexBuildPolicy, NativeAgg, NativeAggResult, Table,
74};
75pub use epoch::{Epoch, EpochAuthority, EpochClock, Snapshot};
76pub use error::{MongrelError, Result};
77pub use external_table::{
78    ExternalTableDefinition, ExternalTableEntry, ModuleArg, ModuleCapabilities,
79};
80pub use gc::{CheckReport, DoctorReport, GcReport};
81pub use index::{
82    AnnIndex, BitmapIndex, ColumnLearnedRange, FmIndex, HotIndex, LearnedIndex, SparseIndex,
83};
84pub use manifest::TtlPolicy;
85pub use memtable::{Memtable, Row, Value};
86pub use mutable_run::MutableRun;
87pub use page::{CachedPage, Encoding, PageStat};
88pub use pitr::{
89    read_pitr_manifest, restore_pitr, PitrArchiveManifest, PitrArchiveReport, PitrChunkRef,
90    PitrCommitPoint, PitrCredentials, PitrTarget,
91};
92pub use procedure::{
93    ProcedureBody, ProcedureCallOutput, ProcedureCallResult, ProcedureCallRow, ProcedureCondition,
94    ProcedureEntry, ProcedureMode, ProcedureParam, ProcedureStep, ProcedureValue, StoredProcedure,
95};
96pub use query::{Condition, Query};
97pub use replication::{
98    is_replica, replica_epoch, write_replica_epoch, ReplicationBatch, ReplicationSnapshot,
99};
100pub use reservoir::Reservoir;
101pub use retention::{OwnedSnapshotGuard, SnapshotGuard, SnapshotRegistry};
102pub use rowid::{RowId, RowIdAllocator};
103pub use schema::{
104    AlterColumn, ColumnDef, ColumnFlags, DefaultExpr, IndexDef, IndexKind, Schema, TypeId,
105};
106pub use security::{
107    ColumnMask, MaskStrategy, PolicyCommand, RowPolicy, SecurityCatalog, SecurityExpr,
108};
109pub use sorted_run::{
110    read_column_dir, read_header, write_run, write_run_with, ColumnPayload, RunHeader, RunReader,
111    RunSpec, RunWriter,
112};
113pub use trace::{IndexRebuild, QueryTrace, ScanMode};
114pub use trigger::{
115    StoredTrigger, TriggerCell, TriggerCondition, TriggerConfig, TriggerDefinition, TriggerEntry,
116    TriggerEvent, TriggerExpr, TriggerProgram, TriggerRaiseAction, TriggerStep, TriggerTarget,
117    TriggerTiming, TriggerValue,
118};
119pub use txn::{IsolationLevel, OwnedRow, PutResult, UpsertAction, UpsertActionKind, UpsertResult};
120pub use wal::{AddedRun, DdlOp, Op, Record, SharedWal, Wal, WalReader, SYSTEM_TXN_ID};
121
122#[cfg(feature = "encryption")]
123pub use encryption::{AesCipher, ColumnKeyDescriptor, EncryptionDescriptor, Kek};