Skip to content

Playground ​

Want to try hyper-sql without installing anything? Open the playground right in your browser.

Each preset is a complete example project. Click the example title in the toolbar to browse the picker: examples for the selected dialect (SQLite or Postgres) appear first, grouped by topic from "Start here" through "Column types", followed by error reproductions. You can filter the list by typing, navigate with the arrow keys and Enter, or step through examples using the previous/next buttons beside the title. Switching dialects automatically opens the matching example in the other dialect when one exists.

The bar beneath the toolbar summarizes what the current example demonstrates. Project files appear in the sidebar with schema.sql, your .sql queries, and main.ts at the top, followed by tsconfig.json, sql.lock, and expected.txt.

How the playground works ​

  • Live type-checking: Every edit triggers hyper-sql's mapper on your .sql files and sql.lock, producing read-only .sql.gen.ts modules under Generated and type-checking main.ts against them. SQL issues are underlined directly in your .sql files, TypeScript mismatches are underlined in main.ts, and both appear in the Problems tab (with a live error count in the toolbar).
  • Pull: Clicking Pull loads schema.sql into an in-browser database, inspects every query, and updates sql.lock—just like running hyper-sql pull locally. The playground also pulls automatically 400 ms after you edit any .sql file.
  • Run: Clicking Run executes program() from main.ts against the in-browser database and switches to the Output tab. An unmodified preset always matches its expected.txt.

SQLite (WASM) and Postgres (PGlite—a full Postgres compiled for the browser) are lazy-loaded the first time you need them. Everything runs locally in your tab; nothing is sent to a server.

Selecting any example updates the URL hash to #preset=<group>/<name>, so you can copy the URL to share it directly—for example sqlite/search-page. If a hash points to an unknown preset, the playground displays a notice. You can also jump to any preset from the Examples and Errors pages.

Differences from running locally ​

Because TypeScript 7 doesn't have a browser build yet, the playground type-checks using TypeScript 6 in memory. Locally, TypeScript 7.1 runs the exact same hyper-sql mapper natively as a content mapper.