gizmobench
BrowseDaily

Query a SQLite Database File Online

This workspace selects Current database and starts with a query listing tables, views and their schema SQL. Open a database file first, then press Run to inspect it. Replace the query with your own SQLite SELECT, join, CTE or write statement. Runs operate on the browser copy of the file; use the .sqlite button to keep changes.

resultsql.js 1.14.2

Press Run, or Ctrl+Enter in the editor. The first run downloads the 643.0 KB SQLite engine from this site and checks it against a pinned SHA-256 hash.

Engine
SQLite 3.49.1
Time limit
2 s a run
Limits
64 KB SQL, 10 MB file
Result
none yet
Each run starts from

Ctrl+Enter (Cmd+Enter on a Mac) runs the script. It holds up to 65,536 bytes (64 KB) and is kept in this browser until you press Reset. The database is held in this tab only and is never saved, so download it with the .sqlite button to keep it.

Tables in the database

No database yet. Run a script that creates a table, or open a SQLite file of up to 10 MB.

Examples

Each one loads into the editor, and the result beside it is what running it gives.

  • CREATE, INSERT, JOINtwo tables, a join and a filter
    2 joined rows: Ada 19.5, Grace 42.75
  • BEGIN, INSERT, ROLLBACKorders holds 3 rows
    SELECT COUNT(*) FROM orders still returns 3
  • Recursive query with no endWITH RECURSIVE r(n) AS (SELECT 1 UNION ALL SELECT n + 1 FROM r)
    stopped at 2 s, the database as it was before the run
  • Running total with a window functionSUM(amount) OVER (ORDER BY day)
    3 rows, running_total 120, 200, 400
  • JSON inside a columnjson_extract on a TEXT column, grouped
    free 1, pro 1

What SQLite here can and cannot do

The engine is the real SQLite. These are the edges this page adds or keeps.

  • SQLite syntax only
    MySQL, PostgreSQL and SQL Server features that SQLite lacks fail with SQLite's own message, and SHOW, DESCRIBE, NOW(), GETDATE(), SELECT TOP and the shell's dot commands get a hint naming the SQLite way.
  • One database, no connections
    ATTACH and DETACH are turned off, and nothing here connects to a server or to any other database.
  • No extensions
    load_extension() does not exist in this build, so no extension can be loaded.
  • 2 seconds a run
    A run that takes longer is stopped: its worker is replaced and the database goes back to how it was before the run.
  • Bounded results
    Each result shows up to 1,000 rows, a run shows up to 20 results and 50,000 values in all, and a text value shows its first 1,000 characters. A note marks anything cut.
  • Memory and size
    SQLite may use up to 128 MB of memory, and a database stays within 10 MB: an INSERT that would pass it fails with database or disk is full, and a run that ends larger is not kept.
  • Temporary tables last one run
    Each run starts a new SQLite, so a CREATE TEMP TABLE is gone when its run ends. Use a normal table with Current database to keep data.

Engine and licence

SQLite is in the public domain (sqlite.org/copyright.html). It is compiled to WebAssembly by sql.js 1.14.2, MIT licensed by the sql.js authors, whose JavaScript this page bundles. Both load the first time you run a script or open a file. The engine file is served from this site unmodified; the licence file holds the complete sql.js notice.

FileWhat it isSizeLicenceSHA-256
sql-wasm.wasmSQLite 3.49.1 compiled to WebAssembly by sql.js, package/dist/sql-wasm.wasm (downloaded when first needed)658,410 bytesMIT (sql.js); SQLite itself is public domain38c14f6e379210bc942bdc4ebca44e7bfdb4318ecc1c72ca666a28fdce96670a
sqljs-LICENSE.txtThe sql.js licence notice, package/LICENSE2,199 bytesMIT60a3f6e4d7b29b4321359e683b36cf198d24f58e24582070f56e6fa89d5ee2be

Databases up to 10 MB (10,485,760 bytes) open from your device and are never uploaded.

Accuracy. Runs the SQLite dialect only, SQLite 3.49.1 through sql.js 1.14.2, in a worker in your browser: there is no connection to MySQL, PostgreSQL or any other database, and extensions cannot be loaded. Every run gets a fresh worker that is stopped at 2 seconds, and each result shows its first 1,000 rows at most, with a note when rows were cut. Scripts up to 64 KB and database files up to 10 MB stay on your device.

Common questions

What happens if I press Run before opening a file?
The current database is initially empty. The schema query returns no application tables. Open a compatible .db, .sqlite or .sqlite3 file, then run the query again.
Can it execute joins and functions against my file?
Yes. It uses SQLite 3.49.1, so ordinary SQLite joins, aggregates, window functions and built-in JSON functions run. ATTACH, external extensions and connections to other database engines are unavailable.
Can I keep the file read-only?
SQLite Viewer provides a read-only single-table browser. This playground permits write statements against its in-memory copy, so restrict your script to SELECT if you only want to read. It never overwrites the file on your disk.
Can I open WAL or encrypted files?
Open an ordinary unencrypted main database file of up to 10 MB. This workflow does not decrypt files or merge a -wal sidecar. Use a closed, checkpointed copy when your application uses WAL mode.

Runs the SQLite dialect only, SQLite 3.49.1 through sql.js 1.14.2, in a worker in your browser: there is no connection to MySQL, PostgreSQL or any other database, and extensions cannot be loaded. Every run gets a fresh worker that is stopped at 2 seconds, and each result shows its first 1,000 rows at most, with a note when rows were cut. Scripts up to 64 KB and database files up to 10 MB stay on your device.