DevTools Logo

SQLite WASM Studio

SQLite WASM Studio

Run SQLite queries locally in an official SQLite WebAssembly database

SQL editor

Multiple semicolon-separated statements are supported. Data stays in this browser tab.

Uses the official @sqlite.org/sqlite-wasm package loaded lazily on demand. Explore sqlite_master schema entries, query result tables, and deterministic foreign-key relationship data locally in your browser.

Examples

Quote-safe batch

Input
executeSql(db, "CREATE TABLE notes (body TEXT); INSERT INTO notes VALUES ('a;b'); SELECT * FROM notes")
Output
{ columns: ["body"], rows: [{ body: "a;b" }] }

The semicolon inside the string literal never splits the INSERT.

Foreign-key map

Input
extractForeignKeyRelations([{ name: "posts", sql: "CREATE TABLE posts (author_id INTEGER REFERENCES users(id))" }])
Output
[{ fromTable: "posts", fromColumns: ["author_id"], toTable: "users", toColumns: ["id"] }]

Inline REFERENCES resolve to a from/to column mapping without running WASM.

About this tool

SQLite WASM Studio runs SQL in the browser with createDb, executeSql(db, sql), readSchema(db), and inspectDatabase(db, sql): the official @sqlite.org/sqlite-wasm module lazy-loads, opens an in-memory database, and executes each quote-aware statement in order.

Splitting is literal-safe through splitSqlStatements: single, double, backtick, and bracket quoting plus doubled-quote escapes keep semicolons inside 'a;b' intact, while empty input returns empty columns and rows without touching the database.

Schema intelligence is pure with no WASM dependency: extractForeignKeyRelations parses sqlite_master CREATE TABLE SQL for table-level FOREIGN KEY clauses and inline REFERENCES, and executeSql returns the last SELECT, PRAGMA, or WITH result with columns taken from the first row keys.

How to use this tool

  1. Open the database

    Create an in-memory database — the WASM module loads lazily in the browser.

  2. Run SQL batches

    Separate statements with semicolons; quoted semicolons stay intact.

  3. Read the result

    Check columns and rows from the final SELECT, PRAGMA, or WITH statement.

  4. Inspect relations

    Read schema entries and extracted foreign-key links between tables.

Use cases

Prototyping queries

Test CREATE, INSERT, and SELECT flows in a disposable in-memory database.

Mapping relationships

Extract foreign-key edges from CREATE TABLE text for ER sketches.

Splitting migration scripts

Divide multi-statement SQL without breaking quoted semicolons.

Common mistakes

Mistake:Expecting every statement's rows back.

Fix:Only the last SELECT, PRAGMA, or WITH result returns — run queries one at a time to keep each.

Mistake:Reading columns from an empty SELECT.

Fix:With zero rows there are no keys to list, so columns return empty by design.

Mistake:Assuming FK extraction needs a live database.

Fix:extractForeignKeyRelations parses CREATE TABLE strings directly — pass schema entries instead.

Frequently asked questions

What does this tool do?

It opens an in-memory SQLite database via WASM, executes semicolon batches with executeSql, reads sqlite_master with readSchema, and maps relations with extractForeignKeyRelations.

How are statements split and results picked?

Splitting respects single, double, backtick, and bracket quoting with doubled-quote escapes, and only the last SELECT, PRAGMA, or WITH result returns with columns from the first row keys.

Is my SQL uploaded or stored?

No. WASM execution, schema reads, and FK parsing run fully client-side in a disposable in-memory database.

Why empty columns, or no FK edge?

Zero-row SELECTs have no keys so columns stay empty, and only CREATE TABLE text with FOREIGN KEY or REFERENCES clauses yields relations — views and plain tables map to none.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML