Utilities
Run read-only SQL against a SQLite database file
A SQLite file and query in, structured rows out.
overview
What sqlite3 does
SQLite opens one connected database file in read-only mode and executes the SQL supplied through --query. Results can be written as JSON, CSV, list, or a human-readable table.
Enable --header when text formats should include column names. JSON output already preserves column names and is the most direct choice for scripts and downstream transformations.
The node does not mutate the connected database. It is intended for SELECT statements and inspection, not migrations, inserts, or long-running database services.
source github.com/sqlite/sqlite
use cases
Where sqlite3 fits
Filter an embedded dataset
Select only the records needed from a SQLite artifact produced upstream.
Export rows as JSON
Turn relational query results into structured workflow output.
Inspect scanner databases
Read summary tables from tools that package findings in SQLite files.
reference
sqlite3 inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| database | FILE | --database | SQLite database file. |
| query | STRING | --query | Read-only SQL query. |
| output-format | STRING | --output-format | Result format. |
Showing key inputs. sqlite3 exposes 4 inputs in total.
Full flag reference (4 inputs)
| Name | Type | Flag | Description |
|---|---|---|---|
| database | FILE | --database | SQLite database file |
| query | STRING | --query | Read-only SQL query to execute |
| output-format | STRING | --output-format | Output format: json, csv, list, or table |
| header | BOOLEAN | --header | Include column names in CSV, list, or table output |
example
Run sqlite3
sqlite3 -readonly -json data.db "select name, qty from items order by qty desc"[{"name":"beta","qty":5},{"name":"alpha","qty":2}]guidance
Choosing sqlite3
Use SQLite when the upstream artifact is a SQLite database file. Use DuckDB for analytical SQL over CSV, JSON, or Parquet files.
duckdb
Queries columnar and text data files with analytical SQL.
csvkit
Inspects and transforms CSV data without a database file.
miller
Streams record-oriented transformations across tabular files.
faq
sqlite3 questions
related
More Utilities tools
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
dnsgen
Wordlist and mined-word subdomain permutation.
duckdb
In-process SQL on CSV, JSON, and Parquet. No server.
edge-tts
Microsoft Edge neural speech from text or a script file. No API key.
Run sqlite3 yourself
A two-row SQLite fixture is queried by quantity and the JSON result is checked for the expected descending order.
Facts on this page come from the live Trickest tool library.