Explore freely.
Graduate cleanly.

A PostgreSQL-compatible database where AI assistants edit your schema directly. When you're ready, export to PostgreSQL—with a clean schema, not 100 migrations.

Built for Claude Code, Cursor, Copilot, and the AI-assisted development workflow.

Go 1.25+ BSL 1.1 Any PostgreSQL Driver
smarterbase@localhost ~ zsh

Works with ActiveRecord in Ruby on Rails

db/migrate/

Exploration Creates Debt

AI makes iteration faster. Traditional databases turn every iteration into permanent baggage.

01

Every Experiment is Permanent

AI helps you iterate 10x faster—which means 10x more migrations.

Your exploration becomes 100+ ALTER TABLEs everyone replays forever.

02

AI Works Harder, Not Smarter

Claude Code could fix your schema in seconds.

If it didn't have to generate migration SQL and coordinate versions.

03

Opaque Data

Can't just cat a record or grep for a value.

Need special tools to see your own data.

04

SQLite Doesn't Match Production

Different SQL dialect than PostgreSQL.

When you graduate, you rewrite queries.

Features

Why SmarterBase Works

AI edits your schema directly. No migrations accumulate. Graduate to PostgreSQL with a clean slate.

No Migrations

Schema is JSON. Edit it directly. No migration files needed.

AI Edits Directly

Claude Code, Cursor, Copilot edit your schema JSON. No migration SQL to generate.

Postgres Compatible

Wire protocol works with any pg driver. Same queries.

See Everything

cat, grep, git diff your data instantly.

NVMe Speed

10-100µs local reads. Faster than network databases.

Clean Graduation

Export final schema to PostgreSQL. No migration history. No ALTER TABLE archaeology.

How It Works

PostgreSQL wire protocol + SQL parser + JSON file storage

Protocol
(pg wire)
Parser
(SQL)
Storage
(JSONL files)

Your App (any PostgreSQL driver)

↓ PostgreSQL wire protocol

smarterbase

↓ JSON files on disk

./data/
├── _schema/
│ └── users.json # {"columns": [...]}
└── users.jsonl # All rows, one JSON per line

Protocol

PostgreSQL wire protocol. Any pg driver works.

Parser

SQL parsing. No query planner needed.

Storage

JSONL files + indexes. Atomic writes.

Built for AI Assistants

One file per table. One JSON object per line. Claude Code sees your entire data model in one command.

  • Full table context – LLMs see your entire table in one cat command.
  • Schema + data togethercat data/_schema/users.json data/users.jsonl
  • Easy editing – No migrations, just edit JSON files directly.
  • Git-friendly – Track schema and data changes with version control.
# Schema
cat data/_schema/users.json
{
  "name":"users",
  "columns":[
    {"name":"id","primary_key":true},
    {"name":"name","type":"text"},
    {"name":"email","type":"text"}
  ]
}

# Data (JSONL - one row per line)
cat data/users.jsonl
{"id":"u1","name":"Alice","email":"alice@example.com"}
{"id":"u2","name":"Bob","email":"bob@example.com"}

# Claude Code sees your whole data model—and edits it directly

Supported SQL

Single-table CRUD covers 90% of prototype needs

Supported

-- Data Definition
CREATE TABLE users (
 id UUID PRIMARY KEY,
 email TEXT, name TEXT
);
CREATE INDEX idx_role ON users(role);
-- Queries
SELECT * FROM users WHERE id = $1
SELECT * FROM users ORDER BY id DESC LIMIT 10

Not Supported (Use PostgreSQL)

-- No JOINs
SELECT * FROM users u JOIN orders o...
-- No aggregations
SELECT COUNT(*) FROM users
-- No transactions
BEGIN; INSERT ...; COMMIT;
If you need these, migrate to PostgreSQL.
The Journey

From Exploration to Production

Use SmarterBase while you're figuring things out. Graduate to PostgreSQL when you're ready—with a clean slate.

Phase 1

Explore

You don't know your schema yet. That's fine.

  • AI edits schema directly
  • Changes are instant
  • Mistakes cost nothing
  • No migrations accumulate
Phase 2

Solidify

Schema stabilizes. You're building features.

  • Still no migration debt
  • Test with real queries
  • Same PostgreSQL dialect
  • Data in version control
Phase 3

Graduate

Ready for production. Clean handoff.

  • Export final schema only
  • No migration history
  • Queries already work
  • Fresh PostgreSQL start

Graduate when you need: Transactions · JOINs · Aggregations · Replication · >1M rows/table

Open Source

Free to use. BSL 1.1 license (converts to MIT after 4 years).

Free Forever

SmarterBase

PostgreSQL-compatible file store

  • PostgreSQL wire protocol
  • JSONL file storage
  • Schema as editable JSON
  • Export to PostgreSQL
$0

Quick Start

Get started in minutes

1

Install & Start

# Install
go install github.com/adrianmcphee/smarterbase/cmd/smarterbase@latest

# Start the server
smarterbase --port 5433 --data ./data
2

Create Tables with SQL

# Connect with psql
psql -h localhost -p 5433

# Create tables
CREATE TABLE users (id UUID PRIMARY KEY, email TEXT, name TEXT);
INSERT INTO users VALUES (gen_random_uuid7(), 'alice@example.com', 'Alice');
3

Edit Schema Directly (No Migrations!)

# Schema is just JSON
cat data/_schema/users.json

# Edit it with your favorite AI tool
claude "add a role column to users"
# → edits data/_schema/users.json directly

Documentation