Features Syntax Install Documentation
No database server required

Run SQL. Skip the server.

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.

0server deps
46tests passing
5SQL operations
zerobase — query
Tables
users
products
orders
History
Settings
users
3 rows
JSON
./storage/users.json
zerobase›SELECT * FROM users WHERE age > 18;
✓ 2 row(s) returned · 1ms
zerobase›
Used by developers at
Unstop Devfolio MLH Hackerearth Hackathon.com Devpost Hacktoberfest Product Hunt GitHub Indie Hackers Unstop Devfolio MLH Hackerearth Hackathon.com Devpost Hacktoberfest Product Hunt GitHub Indie Hackers

Built for developers
who move fast.

Everything you expect from a database, with none of the infrastructure. Start querying in under 30 seconds.

Zero Setup

One zerobase init and you're running. No config files, connection strings, or Docker containers.

Real SQL Syntax

WHERE with AND/OR, ORDER BY, LIMIT, COUNT, SUM, MIN, MAX, AVG. A clean, complete subset — not a toy language.

JSON Storage

Your data lives in plain, readable JSON files. Commit them, inspect them, back them up — no binary formats.

Helpful Errors

Every invalid query shows what went wrong, what was expected, and a working example. No cryptic codes.

Runtime SDK

Use it in Node.js with require('zerobase-cli'). Same SQL, same results, no extra config.

Works Anywhere

Run from any subdirectory — Zerobase walks up to find your storage, just like git finds .git.

Clean syntax.
Powerful queries.

A precise SQL subset that covers every operation you need for local data — no joins, no compromises on everything else.

Schema Management

Define tables with typed columns and a primary key. Drop them just as easily.

Typed columns

INT, TEXT, FLOAT, BOOL — with automatic type validation on insert.

Auto primary key

Declare PRIMARY KEY and Zerobase auto-increments it on every insert.

DROP TABLE

Remove a table and its data file cleanly with DROP TABLE.

CREATE / DROPSCHEMA
CREATE TABLE products (
  id    INT PRIMARY KEY,
  name  TEXT,
  price FLOAT,
  live  BOOL
);

-- remove a table
DROP TABLE products;

Insert Rows

Standard INSERT syntax. The primary key is auto-assigned so you never have to track it yourself.

Auto-increment ID

Skip the primary key column — Zerobase assigns the next available ID.

Schema validation

Every insert is checked against your schema — wrong types throw clear errors.

INSERT INTOWRITE
INSERT INTO products
  (name, price, live)
VALUES
  ('Widget Pro', 49.99, 1);

-- id is auto-assigned: 1
-- ✓ 1 row inserted · 2ms

Query Your Data

Full WHERE support with AND/OR logic, column projection, ORDER BY, and LIMIT.

AND / OR conditions

Chain multiple WHERE conditions with AND or OR operators.

ORDER BY + LIMIT

Sort results ASC or DESC and cap the result set with LIMIT.

SELECTREAD
SELECT * FROM products
  WHERE price > 10
    AND live = 1
  ORDER BY price DESC
  LIMIT 5;

Aggregate Functions

Run COUNT, SUM, MIN, MAX, and AVG across any column — with optional aliases.

COUNT, SUM, AVG

Compute counts and numeric aggregates across filtered rows.

Column aliases

Rename output columns with AS for clean, readable results.

AGGREGATESCOMPUTE
SELECT
  COUNT(*) AS total,
  AVG(price) AS avg_price,
  MAX(price) AS highest
FROM products
WHERE live = 1;

From query to result,
without the friction.

Every SQL string passes through a lightweight regex parser, gets validated against your schema, and executes against plain JSON.

01
SQL String
Input
02
Parser
Regex AST
03
Validate
Schema
04
Execute
JSON I/O
05
Result
Done

Loved by builders

"Finally a local DB that doesn't need Docker. I prototyped a full REST API in an afternoon — Zerobase just got out of my way."
AK
Arjun Kapoor
Fullstack Dev, Freelance
"The error messages are what sold me. It tells you exactly what's wrong and shows the correct syntax. Perfect for teaching SQL."
SM
Sunita Mehta
CS Instructor, IIT
"Hackathon gold. We had a working backend with real SQL queries in 20 minutes. The JSON storage meant no setup headaches at 2am."
RV
Rahul Verma
Hackathon Winner, Mumbai

Up in 30 seconds.

Install once, use everywhere. Works in any Node.js project.

$ npm install zerobase-cli
1
Run zerobase init in your project root to create ./storage/
2
Open the SQL shell with zerobase query — supports ↑ ↓ history
3
Or use the SDK: const db = require('zerobase-cli') then call db.query(sql)

Frequently asked

How is Zerobase different from SQLite?
SQLite uses a binary file format and requires a C library or native bindings. Zerobase uses plain JSON files — human-readable, git-committable, and requiring zero native dependencies. It's a deliberate tradeoff: Zerobase is for prototyping and local tooling, not production-scale data.
Can I use it in a production app?
Zerobase is designed for local development, prototyping, hackathons, and offline-first tools. For production apps with concurrent users, use a real database server. Zerobase doesn't support concurrent writes or transactions.
What Node.js version does it require?
Zerobase works with Node.js 14 and above. It has no native bindings and uses only the built-in fs, path, and readline modules — plus optional UI packages (chalk, figlet, boxen, gradient-string) for the CLI.
Where is my data stored?
All data lives in ./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.
Does it work from subdirectories?
Yes. Zerobase walks up the directory tree from wherever you run it to find storage/schema.json — exactly like how git finds .git. So zerobase query works from src/routes/, tests/, or any subfolder.

Ready to query
without the chaos?

Free to use. MIT licensed. No sign-up required.

No spam · Just release notes and new features