| Crates.io | llkv |
| lib.rs | llkv |
| version | 0.8.5-alpha |
| created_at | 2025-10-23 14:40:19.254314+00 |
| updated_at | 2025-12-03 13:57:03.977041+00 |
| description | An Apache Arrow columnar storage layer with SQL for key-value storage systems. |
| homepage | |
| repository | https://github.com/jzombie/rust-llkv |
| max_upload_size | |
| id | 1897201 |
| size | 115,871 |
Work in Progress
llkv is the primary entrypoint crate for the LLKV database toolkit. It provides both a command-line interface and a library that re-exports high-level APIs from the underlying workspace crates.
Arrow column chunks are stored under pager-managed physical keys, so pagers that already offer zero-copy reads—like the SIMD-backed simd-r-drive—can return contiguous buffers that stay SIMD-friendly.
The llkv binary supports three modes:
Start an interactive session with an in-memory database:
cargo run -p llkv
Available commands:
.help — Show usage information.open FILE — Open a persistent database file (planned).exit or .quit — Exit the REPLPipe SQL scripts to stdin for batch execution:
echo "SELECT 42 AS answer" | cargo run -p llkv
Execute SLT test files or directories:
# Run a single test
cargo run -p llkv -- --slt tests/slt/example.slt
# Run a test directory
cargo run -p llkv -- --slt tests/slt/
# Use multi-threaded runtime
cargo run -p llkv -- --slt tests/slt/ --slt-runtime multi
The llkv crate re-exports the core SQL engine and storage abstractions for programmatic use.
use std::sync::Arc;
use llkv::{SqlEngine, storage::MemPager};
// Create an in-memory SQL engine
let engine = SqlEngine::new(Arc::new(MemPager::default()));
// Execute SQL statements
let results = engine.execute("CREATE TABLE users (id INT, name TEXT)").unwrap();
let results = engine.execute("INSERT INTO users VALUES (1, 'Alice'), (2, 'Bob')").unwrap();
// Query data
let batches = engine.sql("SELECT * FROM users WHERE id > 0").unwrap();
The following is a non-exhaustive list of some of the APIs this crate re-exports. Enable the simd-r-drive-support feature flag when you need durable storage via the SIMD R-Drive pager.
SqlEngine — Main SQL execution engine from llkv-sqlstorage::MemPager — In-memory pager for transient databasesstorage::Pager — Trait for custom storage backendsstorage::SimdRDrivePager — Durable pager backed by simd-r-drive (requires the simd-r-drive-support feature)Error / Result — Error handling typesFor persistent databases, enable the simd-r-drive-support feature and use a file-backed pager. Replace the version tag with the latest release published on crates.io when you upgrade:
[dependencies]
llkv = { version = "0.8.5-alpha", features = ["simd-r-drive-support"] }
use std::sync::Arc;
use llkv::{SqlEngine, storage::SimdRDrivePager};
let pager = SimdRDrivePager::open("database.llkv").unwrap();
let engine = SqlEngine::new(Arc::new(pager));
LLKV is organized as a layered workspace with each crate focused on a specific responsibility:
llkv-sql) — Parses SQL and manages the SqlEngine APIllkv-plan, llkv-expr) — Logical plans and expression ASTsllkv-runtime, llkv-transaction) — Transaction orchestration and MVCCllkv-executor, llkv-aggregate, llkv-join) — Query evaluation and streaming resultsllkv-table, llkv-column-map, llkv-storage) — Columnar storage and pager abstractionsSee the workspace root README and DeepWiki documentation for detailed architecture information.
Licensed under the Apache-2.0 License.