Expand description
MongrelDB core — a log-structured columnar store with sub-ms writes, learned indexes over a shared row-id space, page-level native encryption, an MVCC-tagged content-addressed cache, and an AI-native access layer.
The crate owns the WAL + memtable + Bε-tree write path, sorted-run container formats, MVCC snapshots, page cache, encryption, compaction, and indexes.
Re-exports§
pub use auth::hash_password;pub use auth::verify_password;pub use auth::Permission;pub use auth::Principal;pub use auth::RoleEntry;pub use auth::UserEntry;pub use be_tree::BeTree;pub use cache::PageCache;pub use columnar::decode_column;pub use columnar::encode_column;pub use cursor::drain_cursor_to_columns;pub use cursor::Cursor;pub use cursor::MultiRunCursor;pub use cursor::NativePageCursor;pub use database::CheckIssue;pub use database::Database;pub use database::ExternalTriggerBaseWrite;pub use database::ExternalTriggerBridge;pub use database::ExternalTriggerWrite;pub use database::ExternalTriggerWriteResult;pub use encryption::Cipher;pub use encryption::PlaintextCipher;pub use engine::AggState;pub use engine::ApproxAgg;pub use engine::ApproxResult;pub use engine::CachedAgg;pub use engine::ColumnStat;pub use engine::IncrementalAggResult;pub use engine::IndexBuildPolicy;pub use engine::NativeAgg;pub use engine::NativeAggResult;pub use engine::Table;pub use epoch::Epoch;pub use epoch::EpochAuthority;pub use epoch::EpochClock;pub use epoch::Snapshot;pub use error::MongrelError;pub use error::Result;pub use external_table::ExternalTableDefinition;pub use external_table::ExternalTableEntry;pub use external_table::ModuleArg;pub use external_table::ModuleCapabilities;pub use gc::CheckReport;pub use gc::DoctorReport;pub use gc::GcReport;pub use index::AnnIndex;pub use index::BitmapIndex;pub use index::ColumnLearnedRange;pub use index::FmIndex;pub use index::HotIndex;pub use index::LearnedIndex;pub use index::SparseIndex;pub use memtable::Memtable;pub use memtable::Row;pub use memtable::Value;pub use mutable_run::MutableRun;pub use page::CachedPage;pub use page::Encoding;pub use page::PageStat;pub use procedure::ProcedureBody;pub use procedure::ProcedureCallOutput;pub use procedure::ProcedureCallResult;pub use procedure::ProcedureCallRow;pub use procedure::ProcedureCondition;pub use procedure::ProcedureEntry;pub use procedure::ProcedureMode;pub use procedure::ProcedureParam;pub use procedure::ProcedureStep;pub use procedure::ProcedureValue;pub use procedure::StoredProcedure;pub use query::Condition;pub use query::Query;pub use reservoir::Reservoir;pub use retention::OwnedSnapshotGuard;pub use retention::SnapshotGuard;pub use retention::SnapshotRegistry;pub use rowid::RowId;pub use rowid::RowIdAllocator;pub use schema::AlterColumn;pub use schema::ColumnDef;pub use schema::ColumnFlags;pub use schema::IndexDef;pub use schema::IndexKind;pub use schema::Schema;pub use schema::TypeId;pub use sorted_run::read_column_dir;pub use sorted_run::read_header;pub use sorted_run::write_run;pub use sorted_run::write_run_with;pub use sorted_run::ColumnPayload;pub use sorted_run::RunHeader;pub use sorted_run::RunReader;pub use sorted_run::RunSpec;pub use sorted_run::RunWriter;pub use trace::IndexRebuild;pub use trace::QueryTrace;pub use trace::ScanMode;pub use trigger::StoredTrigger;pub use trigger::TriggerCell;pub use trigger::TriggerCondition;pub use trigger::TriggerConfig;pub use trigger::TriggerDefinition;pub use trigger::TriggerEntry;pub use trigger::TriggerEvent;pub use trigger::TriggerExpr;pub use trigger::TriggerProgram;pub use trigger::TriggerRaiseAction;pub use trigger::TriggerStep;pub use trigger::TriggerTarget;pub use trigger::TriggerTiming;pub use trigger::TriggerValue;pub use txn::IsolationLevel;pub use txn::OwnedRow;pub use txn::PutResult;pub use txn::UpsertAction;pub use txn::UpsertActionKind;pub use txn::UpsertResult;pub use wal::AddedRun;pub use wal::DdlOp;pub use wal::Op;pub use wal::Record;pub use wal::Wal;pub use wal::WalReader;pub use wal::SYSTEM_TXN_ID;
Modules§
- auth
- User, role, and credential management for MongrelDB’s catalog-level auth.
- be_tree
- Buffered Bε-tree (B-epsilon-tree) over composite
(RowId, Epoch)keys — the Phase 1 memtable target. - cache
- MVCC-tagged, content-addressed page cache.
- catalog
- DB-wide catalog checkpoint (spec §5.1).
- columnar
- Plain columnar encode/decode for the prototype type set.
- compaction
- Tiered compaction (Phase 5) with snapshot retention.
- constraint
- Engine-side declarative constraints (unique, foreign key, check) enforced
authoritatively inside the core transaction path. Opt-in per-table via
crate::schema::Schema::constraints; tables with an empty constraint set (the default — including every legacy table and every Kit-managed table) behave exactly as before. This subsystem is independent of the Kit’s own guard-table mechanism: the Kit continues to enforce its constraints exactly as before, and these engine constraints only fire for tables whose schema carries a non-emptyTableConstraints. - cursor
- Lazy, page-aware native-column cursor for streaming scans (Phase 6.2).
- database
- Multi-table
Databasecontainer (spec §5, §6, §10). - encryption
- Native page-level encryption (optional, behind the
encryptionfeature). - engine
- The engine tying the write and read paths together.
- epoch
- error
- external_
table - gc
- Operational tools: garbage collection and integrity check.
- global_
idx - Global index file —
_idx/global.idx. - index
- Indexes. All share the
crate::rowid::RowIdspace so multi-condition queries intersect with SIMD bitmap ops. - manifest
- Manifest — the atomic pointer to the current set of sorted runs.
- memtable
- In-memory write buffer (the “memtable”).
- mutable_
run - Mutable run tier — the LSM layer between the skip-list memtable and the
immutable
.srsorted runs (Phase 11.1). - page
- pma
- Packed Memory Array — a cache-oblivious sorted array with amortized
O(log² n)insert and no full rewrite per insert. - procedure
- query
- Tool-call-native query surface.
- reservoir
- Reservoir sampling for approximate analytics (Phase 8.2).
- retention
- Global snapshot-retention registry for a multi-table
Database. - rowid
- schema
- sorted_
run - Sorted Run — the immutable columnar unit (
.sr). - trace
- Query path instrumentation (OPTIMIZATIONS.md Priority 0 / 16).
- trigger
- tsv
- TSV import/export (MongrelDB-compatible format).
- txn
- Cross-table transactions on the shared WAL (spec §8.2, single-applier subset — parallelism arrives in P3).
- wal
- Append-only, group-commit, torn-write-safe WAL.