hyper-sql playground
Loading… Docs

How the playground works

Each preset is a real project from hyper-sql's examples/ folder. Everything runs locally in your browser tab—nothing is sent to a server. Editable project files (schema.sql, src/*.sql, and main.ts) appear at the top of the file list, followed by tsconfig.json, sql.lock, and expected.txt.

  1. Pull loads schema.sql into an in-browser database (SQLite WASM or Postgres via PGlite), inspects every query's columns and parameters, and updates sql.lock—just like hyper-sql pull locally. Editing any .sql file triggers an automatic pull after 400 ms.
  2. Check compiles each .sql file and sql.lock into a read-only .sql.gen.ts module under Generated, then type-checks main.ts against them. SQL errors are underlined in your queries, TypeScript errors in main.ts, and both appear in the Problems tab.
  3. Run executes program() in main.ts against the in-browser database and prints the result under Output. An unmodified example matches its expected.txt.

In the file list, ● N shows the error count for that file, ↻ marks the lock updated by Pull, and ▶ or ✗ shows the status of main.ts after Run.

Because TypeScript 7 has no browser build yet, the playground checks with TypeScript 6; locally, TypeScript 7.1 runs the same mapper natively. To see lock-file checking in action, pick Outdated sql.lock under Errors: project setup and click Pull.