2.2k stars · MIT · v1.2.3 (2026-05-29), read from /releases/latest on 2026-09-18; the release page states ten commits have landed since · Track this in Scout
Runs SQL queries directly against CSV, LTSV, JSON, YAML and TBLN files, with no database involved.
▶Repo detailsthe review · specs · pros & cons · install
What it is
A command-line program written in Go. SQL is the language you use to ask a database questions. Trdsql loads your file into a temporary database in memory, runs your query against it, and prints the result. It reads CSV, TSV, LTSV, JSON, YAML and TBLN, and it can write out as CSV, JSON, a Markdown table or several other shapes.What it is good for. Anyone with a folder full of exports that nobody ever looks at properly. The problem it removes is the small program you write, use once and throw away. It will also join a CSV against a JSON file in a single query, which is the thing a spreadsheet cannot do at all. A short line about ScalpingMate: trade exports arrive as CSV, and counting how many trades in a month closed at a loss is now one line rather than a script.
- It joins two files of different formats in one query, which nothing else in this ledger does as simply.
- It prints the answer as CSV, JSON, a Markdown table or an aligned table, so the result goes straight into a document.
- MIT licence, a single binary, and it can be pointed at a real PostgreSQL or MySQL server when the file is too big for memory.
- You have to know some SQL. If you do not, this is a thing to learn rather than a thing to install.
- By default the file is read into memory, so a very large file needs the PostgreSQL mode instead.
- There is no screen and no history. It answers one question and exits.
- harelba/q
The same idea in Python, older and simpler, and it handles fewer file formats.
Track this in Scout - johnkerl/miller
Processes CSV and JSON with its own commands rather than SQL, which is better for reshaping a file and worse for asking it a question.
Track this in Scout
tstack/lnavPublished in Edition 22, it answers SQL questions about log files specifically, with a full screen and history.
Track this in Scout
# With Go installed: go install github.com/noborus/trdsql/cmd/trdsql@latest # Or on macOS: brew install noborus/tap/trdsql # Or download a binary from # https://github.com/noborus/trdsql/releases/latest # Ask a question: trdsql -ih "SELECT symbol, COUNT(*) FROM trades.csv GROUP BY symbol" # Join two files of different formats, and print a Markdown table: trdsql -omd "SELECT t.id, a.name FROM trades.csv AS t JOIN accounts.json AS a ON t.acct = a.id"

