dirsql
v0.3.22
Published
Ephemeral SQL index over a local directory
Readme
dirsql (TypeScript SDK)
TypeScript SDK for dirsql -- napi-rs bindings wrapping the Rust core (dirsql).
Also available as dirsql on crates.io and dirsql on PyPI.
Installation
pnpm add dirsqlPrebuilt binaries ship for linux-x64, linux-arm64, darwin-x64, darwin-arm64, and win32-x64. npm / pnpm pick up the right one via optionalDependencies — no Rust toolchain required.
Usage
import { readFileSync } from "node:fs";
import { DirSQL } from "dirsql";
const db = new DirSQL({
root: "/path/to/directory",
tables: [
{
ddl: "CREATE TABLE users (name TEXT, age INTEGER)",
glob: "data/*.json",
extract: (filePath) => JSON.parse(readFileSync(filePath, "utf8")),
},
],
});
const rows = await db.query("SELECT * FROM users WHERE age > 25");
console.log(rows);Building (from source)
Building from source requires a Rust toolchain.
pnpm install
pnpm buildTesting
pnpm testLicense
MIT
