Skip to content
WeftKitBeta
Modules/WeftKitRel
PostgreSQLSQLite

WeftKitRel

Relational SQL Database

Full-featured embedded SQL database with a cost-based optimizer, MVCC, B+Tree indexes, and vectorized analytics. Superior to SQLite for OLTP workloads.

~1.6 μs

simple SQL parse latency

B+TreeWALMVCCCost-Based OptimizerSQL:2016HOT Updates
Features

Key Features

What makes WeftKitRel stand out.

SQL:2016 Core Subset

Hand-written recursive-descent parser supporting SELECT, INSERT, UPDATE, DELETE, CTEs, views, stored procedures, and triggers.

Cost-Based Optimizer

Selinger-inspired optimizer with histogram statistics, join reordering for up to 12 tables, predicate pushdown, and covering index detection.

MVCC with Snapshot Isolation

Multi-Version Concurrency Control with READ COMMITTED, REPEATABLE READ, and SERIALIZABLE isolation. Readers never block writers.

Multiple Index Types

B+Tree (default), hash index, partial indexes, expression indexes, composite indexes (up to 16 columns), and BRIN for ordered data.

HOT Updates

Heap-Only Tuple updates for modifications that do not change indexed columns — avoids index updates entirely, reducing write amplification.

Vectorized Execution

1024-row batch execution for analytical queries. Over 1 GB/sec throughput in vectorized mode.

Performance

Performance Targets

Real numbers from Criterion benchmarks on reference hardware.

Point read (indexed)< 50 μs p99 (up to 100 GB)
Point write (single row)< 200 μs p99 with WAL fsync
Bulk insert> 500,000 rows/sec for 100-byte rows
Analytical scan> 1 GB/sec (vectorized mode)
Memory footprint (tiny mode)4–16 MB configurable buffer pool
Compatibility

Wire Protocol

WeftKitRel supports the PostgreSQL v3 protocol. Your existing tools just work.

psqlJDBCasyncpglibpqpgx
Code Example

Get Started in Seconds

Add WeftKitRel to your Rust project and start querying.

relational.rs
rust
use weftkitrel::prelude::*;

// Open or create a database
let db = Database::open("my_app.db")?;

// Use the module API
let result = db.query("SELECT * FROM users WHERE active = true")?;

for row in result.rows() {
    println!("{:?}", row);
}
Use Cases

Where to Use It

1

Mobile offline-first apps

2

Embedded analytics on device

3

IoT device configuration store