SQL Playground
A real SQLite database compiled to WebAssembly and running entirely in your browser. Edit a schema, run queries, inspect the EXPLAIN QUERY PLAN, and see an auto-generated ER diagram of your tables. Persists across reloads via localStorage. Nothing is uploaded.
Schema & seed data
Applying a schema resets the database. Your editor content persists in localStorage.
Query
Run a query to see results.
Run a query, then peek here for the SQLite query plan.
Tables appear here after applying a schema.
ER diagram is generated from the CREATE TABLE statements in your schema. FOREIGN KEY edges appear automatically.
What's running here
This page loads sql.js (SQLite compiled to WebAssembly via Emscripten) from a CDN.
A real, in-memory SQLite database is created in your browser. All queries execute locally; nothing
is sent to a server.
The schema editor accepts any DDL or DML SQLite would accept. The Apply schema button tears down the database and rebuilds it from the editor content, then refreshes the Tables and ER Diagram panels.
The ER diagram parser is intentionally forgiving: it reads CREATE TABLE statements
directly, extracts column names + types, and finds foreign keys both as inline
REFERENCES other(col) and as standalone
FOREIGN KEY (col) REFERENCES other(col) declarations.
Run a query with ⌘ Enter on macOS or Ctrl Enter elsewhere.