Crate llkv_runtime

Crate llkv_runtime 

Source
Expand description

Query execution runtime for LLKV.

This crate provides the runtime API (see RuntimeEngine) for executing SQL plans with full transaction support. It coordinates between the transaction layer, storage layer, and query executor to provide a complete database runtime.

§Key Components

  • RuntimeEngine: Main execution engine for SQL operations
  • RuntimeSession: Session-level interface with transaction management
  • TransactionContext: Single-transaction execution context
  • Table Provider: Integration with the query executor for table access

§Transaction Support

The runtime supports both:

  • Auto-commit: Single-statement transactions (uses TXN_ID_AUTO_COMMIT)
  • Multi-statement: Explicit BEGIN/COMMIT/ROLLBACK transactions

§MVCC Integration

All data modifications automatically include MVCC metadata:

  • row_id: Unique row identifier
  • created_by: Transaction ID that created the row
  • deleted_by: Transaction ID that deleted the row (or TXN_ID_NONE)

The runtime ensures these columns are injected and managed consistently.

Re-exports§

pub use runtime_storage_namespace::PERSISTENT_NAMESPACE_ID;
pub use runtime_storage_namespace::PersistentRuntimeNamespace;
pub use runtime_storage_namespace::RuntimeNamespaceId;
pub use runtime_storage_namespace::RuntimeStorageNamespace;
pub use runtime_storage_namespace::RuntimeStorageNamespaceOps;
pub use runtime_storage_namespace::RuntimeStorageNamespaceRegistry;
pub use runtime_storage_namespace::TEMPORARY_NAMESPACE_ID;
pub use runtime_storage_namespace::TemporaryRuntimeNamespace;

Modules§

runtime_storage_namespace
Runtime storage namespace abstractions and registries.

Structs§

AlterTablePlan
Plan for ALTER TABLE operations.
ColumnAssignment
Column assignment for UPDATE.
CreateIndexPlan
Plan for creating an index on a table.
CreateTablePlan
Plan for creating a table.
CreateViewPlan
Plan for creating a view.
DeletePlan
Plan for deleting rows from a table.
DropIndexPlan
Plan for dropping an index.
DropTablePlan
Plan for dropping a table.
DropViewPlan
Plan for dropping a view.
ForeignKeySpec
IndexColumnPlan
Column specification for CREATE INDEX statements.
InsertPlan
Plan for inserting data into a table.
MultiColumnUniqueSpec
Multi-column unique constraint specification.
OrderByPlan
ORDER BY specification.
PlanColumnSpec
Column specification produced by the logical planner.
ReindexPlan
Plan for rebuilding an index.
RenameTablePlan
Plan for renaming a table.
RuntimeContext
In-memory execution context shared by plan-based queries.
RuntimeCreateTableBuilder
RuntimeEngine
RuntimeLazyFrame
Lazily built logical plan (thin wrapper over SelectPlan).
RuntimeRangeSelectRows
Result of parsing a range() SELECT statement.
RuntimeRow
RuntimeSession
A session for executing operations with optional transaction support.
RuntimeTableHandle
RuntimeTransactionContext
Transaction-scoped façade over RuntimeContext.
SelectExecution
Streaming execution handle for SELECT queries.
SelectPlan
Logical query plan for SELECT operations.
TransactionManager
Transaction manager for coordinating sessions.
TransactionSession
A session handle for transaction management.
TransactionSnapshot
Transaction metadata captured when a transaction begins.
TruncatePlan
Plan for TRUNCATE TABLE operation (removes all rows).
TxnIdManager
Transaction ID manager that hands out IDs and tracks commit status.
UpdatePlan
Plan for updating rows in a table.

Enums§

AggregateExpr
Aggregate expression in SELECT.
AssignmentValue
Value to assign in an UPDATE.
CreateTableSource
Source data for CREATE TABLE AS SELECT.
ForeignKeyAction
InsertConflictAction
SQLite conflict resolution action for INSERT statements.
InsertSource
Source data for INSERT operations.
OrderSortType
Sort type for ORDER BY.
OrderTarget
Target column/expression for ORDER BY.
PlanOperation
Recordable plan operation for transaction replay.
PlanStatement
Top-level plan statements that can be executed against a Session.
PlanValue
RuntimeStatementResult
SelectProjection
Projection specification for SELECT.
TransactionKind
Transaction kind enum representing transaction control operations.
TransactionResult
Transaction result enum representing the outcome of a transaction operation.

Constants§

TXN_ID_AUTO_COMMIT
Transaction ID for auto-commit (single-statement) transactions.
TXN_ID_NONE
Transaction ID representing “no transaction” or “not deleted”.

Traits§

IntoInsertRow
IntoPlanColumnSpec
Trait for types that can be converted into a PlanColumnSpec.
TransactionContext
A trait for transaction context operations.

Functions§

extract_rows_from_range
Extract rows from a range() SELECT statement.
row
statement_table_name

Type Aliases§

TxnId
Transaction ID type.