Zerobase is a CLI-first SQL engine that stores data in plain JSON files. Create tables, run queries, use aggregates — with zero setup and no database server.
Everything you expect from a database, with none of the infrastructure. Start querying in under 30 seconds.
One zerobase init and
you're running. No config files, connection strings, or Docker containers.
WHERE with AND/OR, ORDER BY, LIMIT, COUNT, SUM, MIN, MAX, AVG. A clean, complete subset — not a toy language.
Your data lives in plain, readable JSON files. Commit them, inspect them, back them up — no binary formats.
Every invalid query shows what went wrong, what was expected, and a working example. No cryptic codes.
Use it in Node.js with require('zerobase-cli').
Same SQL, same results, no extra config.
Run from any subdirectory — Zerobase walks up to find your storage, just like git finds .git.
A precise SQL subset that covers every operation you need for local data — no joins, no compromises on everything else.
Define tables with typed columns and a primary key. Drop them just as easily.
INT, TEXT, FLOAT, BOOL — with automatic type validation on insert.
Declare PRIMARY KEY and Zerobase auto-increments it on every insert.
Remove a table and its data file cleanly with DROP TABLE.
CREATE TABLE products ( id INT PRIMARY KEY, name TEXT, price FLOAT, live BOOL ); -- remove a table DROP TABLE products;
Standard INSERT syntax. The primary key is auto-assigned so you never have to track it yourself.
Skip the primary key column — Zerobase assigns the next available ID.
Every insert is checked against your schema — wrong types throw clear errors.
INSERT INTO products (name, price, live) VALUES ('Widget Pro', 49.99, 1); -- id is auto-assigned: 1 -- ✓ 1 row inserted · 2ms
Full WHERE support with AND/OR logic, column projection, ORDER BY, and LIMIT.
Chain multiple WHERE conditions with AND or OR operators.
Sort results ASC or DESC and cap the result set with LIMIT.
SELECT * FROM products WHERE price > 10 AND live = 1 ORDER BY price DESC LIMIT 5;
Run COUNT, SUM, MIN, MAX, and AVG across any column — with optional aliases.
Compute counts and numeric aggregates across filtered rows.
Rename output columns with AS for clean, readable results.
SELECT COUNT(*) AS total, AVG(price) AS avg_price, MAX(price) AS highest FROM products WHERE live = 1;
Every SQL string passes through a lightweight regex parser, gets validated against your schema, and executes against plain JSON.
Install once, use everywhere. Works in any Node.js project.
zerobase init in your project root to create ./storage/zerobase query — supports ↑ ↓ historyconst db = require('zerobase-cli') then call db.query(sql)
fs, path, and readline modules — plus optional UI
packages (chalk, figlet, boxen, gradient-string) for
the CLI../storage/ next to your project.
schema.json holds your table definitions, and each table gets its own
tableName.json file. You can read, edit, and back these up like any other file. Add
storage/ to your .gitignore if you don't want to commit data.storage/schema.json — exactly like how git finds .git. So
zerobase query works from src/routes/, tests/, or any subfolder.
Free to use. MIT licensed. No sign-up required.
No spam · Just release notes and new features