Exact by design.
Decimals, instants, UUIDs and more. Validate the meaning of your data, right where it lives.
Explore the typesSQLite, with types that mean something.
For TypeScript, Rust, Go and the command line.
Experimental MIT licensed
CREATE TABLE invoices (
id INT64 PRIMARY KEY,
amount DECIMAL(12,2),
issued_at INSTANT
);
SELECT CAST('0.1' AS DECIMAL)
+ CAST('0.2' AS DECIMAL);Example result · exact decimal arithmetic
npm install @boxdb/clientDecimals, instants, UUIDs and more. Validate the meaning of your data, right where it lives.
Explore the typesBinary SQLite for your application. Readable YAML for small datasets you want to keep in Git.
Choose your storageOne Rust core, four ways in. The same types, migrations and files across every client.
Find your integrationNode.js 22.18+ or Bun · macOS ARM64 or Linux x64/ARM64 with glibc 2.35+
import { BoxDB } from "@boxdb/client";
const db = await BoxDB.open("app.db");
try {
await db.exec("CREATE TABLE IF NOT EXISTS notes(body TEXT NOT NULL)");
await db.query`INSERT INTO notes(body) VALUES(${"Hello, BoxDB."})`;
console.log(await db.query`SELECT body FROM notes`);
} finally {
await db.close();
}Stable Rust · native build tools and libclang
use boxdb::{Database, Format, Value};
fn main() -> boxdb::Result<()> {
let mut db = Database::open("app.db", Format::Binary)?;
db.execute("CREATE TABLE IF NOT EXISTS notes(body TEXT NOT NULL)")?;
db.execute_params(
"INSERT INTO notes(body) VALUES(?)",
&[Value::Text("Hello, BoxDB.".into())],
)?;
println!("{:?}", db.execute("SELECT body FROM notes")?[0].rows);
Ok(())
}Go 1.23+ · cgo and a matching native library — follow the installation guide first
package main
import (
"fmt"
"log"
boxdb "github.com/lebedev-nikita/boxdb/packages/go"
)
func main() {
db, err := boxdb.Open("app.db")
if err != nil { log.Fatal(err) }
defer db.Close()
if _, err = db.Exec("CREATE TABLE IF NOT EXISTS notes(body TEXT NOT NULL)"); err != nil {
log.Fatal(err)
}
if _, err = db.Exec("INSERT INTO notes(body) VALUES(?)", "Hello, BoxDB."); err != nil {
log.Fatal(err)
}
var body string
if err = db.QueryRow("SELECT body FROM notes LIMIT 1").Scan(&body); err != nil {
log.Fatal(err)
}
fmt.Println(body)
}Homebrew on macOS or Linux · no Node.js required
boxdb app.db -e "
CREATE TABLE IF NOT EXISTS notes(body TEXT NOT NULL);
INSERT INTO notes(body) VALUES('Hello, BoxDB.');
SELECT body FROM notes;
"
# Open the interactive SQL shell
boxdb app.dbDeclare what belongs in a column. BoxDB checks it. Exact decimal and temporal arithmetic runs in the engine.
SQL and typesDECIMAL(12,2)Exact amounts. Explicit rounding.INSTANTA point in time, normalized to UTC.ENUM('todo','done')A known set of string values.UUIDIdentifiers with native validation.TEXT[]Collections with typed elements.Keep your application patterns. BoxDB adapters connect the client to your existing libraries.
SQL migrations, schema export, file diagnostics and recovery. Built-in full-text and vector search. Binary replication with Litestream.
Deployment and backupsBoxDB is version 0. APIs and storage contracts can change. Native values and indexes require BoxDB’s patched SQLite engine. Read the tradeoffs before you adopt it.
Is BoxDB a fit?