
SQLPlay is an H2-Console-style SQL playground for JavaScript. It runs a real in-memory SQLite database — SQLite 3.49 compiled to WebAssembly via sql.js — entirely in the browser, so anyone can practice SQL with zero backend and zero setup. On top of the console it adds a LeetCode-style Challenge mode with 50 graded problems. It's published on npm and, from a single codebase, ships four ways: a `npx sqlplay` CLI, a headless library, an embeddable React console, and an Express middleware that runs an H2-style backend console.
Java developers have the H2 Console for quickly practicing SQL against a throwaway database. JavaScript had no comparable zero-setup equivalent — you either installed a database locally or signed up for an online sandbox. There was a clear gap for an instant, local, no-install SQL playground — and no single package that could double as a headless query engine and a drop-in database console for other apps.
SQLPlay puts a friendly console UI on top of sql.js (SQLite compiled to WebAssembly), so a full SQL database runs client-side in the browser with a query editor, schema-aware autocomplete, live schema browser, ER diagram, editable data grid, query history, and CSV/JSON import-export. The core is built around an injectable WASM loader, which lets the exact same engine be delivered four ways from one codebase — the `npx sqlplay` CLI, a headless `createDatabase()` library that also runs in Node, an embeddable `<SqlConsole />` React component, and an Express middleware that keeps the database in your Node process (the true H2 Console model). A Challenge mode compares your result set against a reference solution — order-sensitive where it matters, with numeric tolerance for floats.
SQLPlay is built around an injectable WASM loader, so one core is delivered four ways. In the browser there is no server — the React UI drives sql.js (SQLite compiled to WebAssembly) running a full in-memory database client-side. As an Express middleware the same engine runs inside your Node process, H2-Console style, with the browser talking to it over an API. The CLI is a tiny dependency-free static server that serves the built app.
React + Vite UI
editor · schema · ER · challenges
Injectable WASM loader
one core, four delivery modes
sql.js engine
SQLite 3.49 → WebAssembly
Browser or Node process
in-memory client-side · or Express middleware
Frontend
Database
Distribution