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.

Modules§

storage_namespace

Structs§

ColumnAssignment
Column assignment for UPDATE.
ColumnSpec
Column specification for CREATE TABLE.
CreateIndexPlan
Plan for creating an index on a table.
CreateTablePlan
Plan for creating a table.
DeletePlan
Plan for deleting rows from a table.
ForeignKeySpec
IndexColumnPlan
Column specification for CREATE INDEX statements.
InsertPlan
Plan for inserting data into a table.
OrderByPlan
ORDER BY specification.
QueryExecutor
Query executor that executes SELECT plans.
RowBatch
RuntimeContext
In-memory execution context shared by plan-based queries.
RuntimeContextWrapper
Wrapper for Context that implements TransactionContext
RuntimeCreateTableBuilder
RuntimeEngine
RuntimeLazyFrame
Lazily built logical plan (thin wrapper over SelectPlan).
RuntimeRangeSelectRows
RuntimeRangeSpec
RuntimeRow
RuntimeSession
A session for executing operations with optional transaction support.
RuntimeTableHandle
SelectExecution
Streaming execution handle for SELECT queries.
SelectPlan
Logical query plan for SELECT operations.
UpdatePlan
Plan for updating rows in a table.

Enums§

AggregateExpr
Aggregate expression in SELECT.
AggregateFunction
Supported aggregate functions.
AssignmentValue
Value to assign in an UPDATE.
ColumnNullability
Column nullability specification.
CreateTableSource
Source data for CREATE TABLE AS SELECT.
ForeignKeyAction
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
Result of running a plan statement.
SelectProjection
Projection specification for SELECT.
TransactionKind
Transaction kind enum

Constants§

NotNull
Convenience constant for non-null columns.
Nullable
Convenience constant for nullable columns.

Traits§

IntoColumnSpec
Trait for types that can be converted into a ColumnSpec.
IntoInsertRow
TableProvider
Trait for providing table access to the executor.

Functions§

build_array_for_column
extract_rows_from_range
resolve_insert_columns
row
statement_table_name
Return the table name referenced by a plan statement, if any.

Type Aliases§

Result