Data · 25 tools · nothing uploads

Query a SQLite database

Run SQL against a .db / .sqlite file and read the answer as a table. The database never leaves your device.

Input

Options

Query a SQLite database runs one SQL statement against a .db or .sqlite file and prints an aligned table. sql.js, SQLite compiled to WebAssembly, does the work, and the default statement lists the file's tables. The table stops at 1000 rows, and since the file is only ever read into memory, an INSERT is thrown away.

Questions

Does my database get uploaded?

No. The file is read into memory and opened by sql.js, a build of SQLite compiled to WebAssembly that runs inside the page. The query executes on your device, the results are formatted there, and the database is closed and freed from the WebAssembly heap when the run finishes. Nothing is sent to a server and there are no accounts.

Can I run an INSERT or an UPDATE?

You can run the statement, but the change goes nowhere. The database is opened from a copy in memory and no file is written back, so a write statement runs against that copy and is discarded when the run ends. You get "statement ran, no rows returned" because such a statement produces no columns. Treat this as a read tool.

Why do I only see 1000 rows?

Because that is the cap, and the tool tells you: "first 1000 rows only" with a suggestion to add LIMIT or WHERE. Rows past the cap are never even read, since the statement is stepped row by row rather than materialised in full, which is what stops a million row table from building a million line string in your browser.

Can I run several statements at once?

No, one statement per run. The default is a query that lists the tables in the file, which is a good first thing to run when you do not know the schema. Run your statements one at a time, reading the output of each before the next.

Why did I get "file is not a database"?

Because the bytes you gave it are not SQLite. That message comes from SQLite itself, prefixed with your file name, and it appears when the statement is prepared rather than when the file is opened, because SQLite only reads the header at that point. A zero byte file is caught earlier and refused with "file is empty", since SQLite would otherwise open it as a valid empty database and answer your query with silence.

How are BLOB and NULL values shown?

A NULL prints as NULL and a BLOB prints as its size, in the form <blob 2048 bytes>, because printing the raw bytes would produce a wall of numbers. Everything else prints as text, in a table whose columns line themselves up; nothing is padded by hand. A long text value stays on one line and the table scrolls sideways rather than wrapping it.

Compare

ToolRuns on the CLILive as you type
Query a SQLite databaseYesNo
Profile a CSV datasetYesYes
Diff two CSV datasetsYesNo
JSONL processorYesYes
Filter / grep a log fileYesYes
Flatten / unflatten JSONYesYes

Related Data tools

1→1Profile a CSV datasetPer column: null count, a heuristic majority type (integer/float/boolean/date/string, over non-empty cells), cardinality, and, for integer/float columns, min/max/mean/median/population stddev, or, for ISO-8601 date/timestamp columns, min/max. Read-only. Nothing is changed. Quote-aware. A record with a quoted field containing a literal newline counts as one record.Takes one filen→1Diff two CSV datasetsCompare two CSVs. With a key column: report rows added, removed, and changed (by that key). Without one: a whole-row multiset diff, added/removed counts of exactly-equal rows, order-independent, duplicates counted. Read-only. Quote-aware: a record with a quoted field containing a literal newline is compared as one record.Combines the files you drop1→1JSONL processorValidate a JSON Lines file line by line, or convert it to/from a JSON array. validate never throws on a bad line, naming every one instead; the two convert modes refuse (naming the first bad line) rather than silently dropping or mangling a record.Takes one file1→1Filter / grep a log fileKeep (or drop) lines matching a plain substring or a regex. Like every tool here the whole file is held in memory at once. A log genuinely in the multiple-GB range can exceed what a browser tab can hold; this does not stream from disk.Takes one file1→1Flatten / unflatten JSONFlatten nested JSON into a single-level object with dotted (or custom-separator) keys, e.g. "address.city", or reverse a flat object back into nested JSON objects and arrays.Takes one file