Crate llkv_table

Crate llkv_table 

Source
Expand description

Table abstraction and system catalog for LLKV.

This crate provides the Table type, which builds on llkv-column-map’s columnar storage to offer a higher-level, schema-aware interface. It includes:

  • Table: Schema-aware table abstraction with append, scan, and schema operations
  • SysCatalog: System catalog (table 0) that stores table and column metadata
  • TableMeta and ColMeta: Metadata structures for tables and columns
  • Schema management: Arrow schema integration with field ID tracking
  • Scan operations: Projection, filtering, ordering, and computed columns
  • MVCC integration: Automatic handling of created_by and deleted_by columns

§Architecture

Tables use ColumnStore for physical storage but add:

  • Schema validation and enforcement
  • Field ID assignment and tracking
  • System catalog for metadata persistence
  • MVCC column management
  • Row ID filtering (for transaction visibility)

§Table IDs

  • Table 0: Reserved for the system catalog (stores TableMeta and ColMeta)
  • Tables 1+: User tables

See CATALOG_TABLE_ID and is_reserved_table_id.

§System Catalog

The SysCatalog stores table metadata in table 0, which is a reserved system table.

Re-exports§

pub use catalog::CatalogManager;
pub use catalog::CreateTableResult;
pub use catalog::FieldResolver;
pub use catalog::TableCatalogSnapshot;
pub use catalog::SingleColumnIndexDescriptor;
pub use catalog::SingleColumnIndexRegistration;
pub use constraints::CheckConstraint;
pub use constraints::ConstraintColumnInfo;
pub use constraints::ConstraintEnforcementMode;
pub use constraints::ConstraintExpressionRef;
pub use constraints::ConstraintId;
pub use constraints::ConstraintKind;
pub use constraints::ConstraintRecord;
pub use constraints::ConstraintService;
pub use constraints::ConstraintState;
pub use constraints::ForeignKeyAction;
pub use constraints::ForeignKeyChildRowsFetch;
pub use constraints::ForeignKeyColumn;
pub use constraints::ForeignKeyConstraint;
pub use constraints::ForeignKeyParentRowsFetch;
pub use constraints::ForeignKeyRowFetch;
pub use constraints::ForeignKeyTableInfo;
pub use constraints::InsertColumnConstraint;
pub use constraints::InsertMultiColumnUnique;
pub use constraints::InsertUniqueColumn;
pub use constraints::PrimaryKeyConstraint;
pub use constraints::UniqueConstraint;
pub use constraints::UniqueKey;
pub use constraints::ValidatedForeignKey;
pub use constraints::build_composite_unique_key;
pub use constraints::column_in_foreign_keys;
pub use constraints::column_in_multi_column_unique;
pub use constraints::column_in_primary_or_unique;
pub use constraints::decode_constraint_row_id;
pub use constraints::encode_constraint_row_id;
pub use constraints::ensure_multi_column_unique;
pub use constraints::ensure_primary_key;
pub use constraints::ensure_single_column_unique;
pub use constraints::unique_key_component;
pub use constraints::validate_alter_table_operation;
pub use constraints::validate_check_constraints;
pub use constraints::validate_foreign_key_rows;
pub use constraints::validate_foreign_keys;
pub use ddl::CatalogDdl;
pub use ddl::ObjectNameExt;
pub use ddl::OrderCreateTablesExt;
pub use ddl::TableConstraintExt;
pub use diagnostics::TablePagerIngestionDiagnostics;
pub use diagnostics::TablePagerIngestionSample;
pub use metadata::MultiColumnUniqueRegistration;
pub use metadata::ForeignKeyDescriptor;
pub use metadata::MetadataManager;
pub use reserved::CATALOG_TABLE_ID;
pub use reserved::INFORMATION_SCHEMA_TABLE_ID_START;
pub use reserved::TEMPORARY_TABLE_ID_START;
pub use reserved::is_information_schema_table;
pub use resolvers::canonical_table_name;
pub use resolvers::resolve_table_name;
pub use table::Table;
pub use types::TableColumn;
pub use view::ForeignKeyView;
pub use view::TableConstraintSummaryView;
pub use view::TableView;

Modules§

catalog
Unified catalog module for table and schema management.
constants
constraints
Unified constraint module for constraint management.
ddl
Shared catalog DDL trait for contexts that can execute plan-based schema operations.
diagnostics
Table-level pager diagnostics built on top of pager statistics.
expr
gather
Re-export gather utilities so existing llkv_table::gather imports continue to work while the implementation lives in llkv-column-map.
metadata
Shared metadata manager that consolidates catalog I/O for tables, columns, and constraints.
reserved
Reserved value ranges for system use.
resolvers
schema_ext
Schema extensions for efficient field ID caching.
table
types
Common types for the table core.
view

Structs§

AffineExpr
Represents an affine transformation scale * field + offset.
ColMeta
Metadata about a column.
CustomTypeMeta
Metadata about a custom type (CREATE TYPE/DOMAIN).
MultiColumnIndexEntryMeta
Metadata describing a single multi-column index (unique or non-unique).
NumericKernels
Centralizes the numeric kernels applied to scalar expressions so they can be tuned without touching the surrounding table scan logic.
PlanAnnotations
Aggregate annotations that apply to the whole plan.
PlanEdge
Edge between two planner nodes.
PlanEdgeMetadata
Metadata associated with plan edges or inputs.
PlanExpression
Expression or projection annotations associated with a node.
PlanField
Column description carried with each node’s output schema.
PlanGraph
Immutable DAG describing the planner output.
PlanGraphBuilder
Builder for PlanGraph that enforces DAG invariants while allowing incremental construction.
PlanGraphVersion
Semantic version identifier for the plan graph payload.
PlanInput
Incoming connection for a node.
PlanNode
Planner node with annotations used to describe how operators compose.
PlanNodeId
Unique identifier for a planner node.
SingleColumnIndexEntryMeta
Metadata describing a single named single-column index.
SysCatalog
Interface to the system catalog (table 0).
TableMeta
Metadata about a table.
TableMultiColumnIndexMeta
Metadata describing all multi-column indexes (unique and non-unique) for a table.
TableSingleColumnIndexMeta
Metadata describing all single-column indexes registered for a table.
TableTriggerMeta
Collection of triggers registered for a table.
TriggerEntryMeta
Persisted trigger definition stored alongside table metadata.

Enums§

PlanGraphError
Errors raised while constructing or validating a plan graph.
PlanOperator
Planner node operator kind.
TriggerEventMeta
Trigger event metadata describing which operation fires the trigger.
TriggerTimingMeta
Timing information for a trigger (BEFORE, AFTER, INSTEAD OF).

Constants§

PLAN_GRAPH_VERSION
Current version of the planner IR.
ROW_ID_FIELD_ID
Reserved field ID for row ID columns.

Traits§

RowStream

Functions§

compute_binary

Type Aliases§

FieldId
Unique identifier for a column within a table.
NumericArrayMap
PlanGraphResult
RowId
Unique identifier for a row within a table.
TableId
Unique identifier for a table.