Skip to main content

Crate relational_engine

Crate relational_engine 

Source
Expand description

SQL-like relational engine with SIMD-accelerated filtering.

Provides table storage, indexing, and query execution on top of tensor_store::RelationalSlab for columnar storage.

§Durability Model

When using durable storage (via RelationalEngine::open_durable or RelationalEngine::recover), the following data is persisted:

Persisted and auto-recovered:

  • Table schemas and metadata
  • Row data (columnar storage)
  • B-tree indexes (automatically rebuilt on recovery)
  • Row counters (automatically rebuilt from scanning data)

NOT persisted (must recreate after recovery):

§Recovery Example

// Open durable engine - B-tree indexes are automatically rebuilt
let engine = RelationalEngine::recover(
    "data/wal",
    &WalConfig::default(),
    Some(Path::new("data/snapshot")),
)?;

// Only hash indexes need to be recreated after recovery
for table in engine.list_tables() {
    engine.create_index(&table, "user_id")?;
    // B-tree indexes are already restored!
}

Re-exports§

pub use transaction::Transaction;
pub use transaction::TransactionManager;
pub use transaction::TxPhase;
pub use cursor::CursorBuilder;
pub use cursor::StreamingCursor;
pub use observability::IndexMissReport;
pub use observability::IndexTracker;
pub use observability::QueryMetrics;

Modules§

cursor
Streaming cursor API for memory-efficient large result sets.
observability
Observability infrastructure for relational engine.
transaction
Transaction support for RelationalEngine.

Structs§

Column
Column definition with name, type, and nullability.
ColumnData
Column data with values and null tracking.
ColumnarScanOptions
Options for columnar scan operations.
CursorOptions
Options for cursor-based iteration over query results.
ForeignKeyConstraint
Foreign key constraint definition.
GroupedRow
Result of a grouped aggregate query.
QueryOptions
Options for query execution.
RelationalConfig
Configuration for RelationalEngine resource limits and timeouts.
RelationalEngine
SQL-like relational database engine.
Row
A row with ID and column values.
RowCursor
Iterator over query results.
Schema
Table schema defining column structure.
WalConfig
WAL configuration.

Enums§

AggregateExpr
Aggregate expression for GROUP BY queries.
AggregateRef
Reference to an aggregate in HAVING clause.
AggregateValue
Typed aggregate result value.
ColumnType
Column data type.
Condition
Query filter condition.
Constraint
Table constraint definition.
HavingCondition
HAVING condition for filtering groups after aggregation.
ReferentialAction
Referential action for foreign key constraints.
RelationalError
Errors from relational engine operations.
Value
Query value type.

Type Aliases§

Result
Result type alias for relational engine operations.