You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KiteSQL is a lightweight embedded database inspired by MyRocks and SQLite and completely coded in Rust. It aims to provide a more user-friendly, lightweight, and low-loss RDBMS for Rust programming so that the APP does not rely on other complex components. It can perform complex relational data operations.
Key Features
A lightweight embedded SQL database fully rewritten in Rust
Higher write speed, more user-friendly API
All metadata and actual data in KV Storage, and there is no state component (e.g. system table) in the middle
Supports extending storage for customized workloads
Build: wasm-pack build --release --target nodejs (outputs to ./pkg; use --target web or --target bundler for browser/bundler setups).
Usage:
import{WasmDatabase}from"./pkg/kite_sql.js";constdb=newWasmDatabase();awaitdb.execute("create table demo(id int primary key, v int)");awaitdb.execute("insert into demo values (1, 2), (2, 4)");constrows=db.run("select * from demo").rows();console.log(rows.map((r)=>r.values.map((v)=>v.Int32??v)));
In Node.js, provide a small localStorage shim if you enable statistics-related features (see examples/wasm_index_usage.test.mjs).
Examples
use kite_sql::db::{DataBaseBuilder,ResultIter};let kite_sql = DataBaseBuilder::path("./data").build()?;
kite_sql
.run("create table if not exists t1 (c1 int primary key, c2 int)")?
.done()?;
kite_sql
.run("insert into t1 values(0, 0), (1, 1)")?
.done()?;letmut iter = kite_sql.run("select * from t1")?;// Query schema is available on every result iterator.let column_names:Vec<_> = iter.schema().iter().map(|c| c.name()).collect();println!("columns: {column_names:?}");for tuple in iter {println!("{:?}", tuple?);}