@ports, I'd like to suggest to import textproc/trdsql.
trdsql is a CLI tool which allows to run SQL query against CSV, LTSV, JSON, YAML and TBLN files. This tool is similar to others such as q and textql, with a key distinction: it allows the use of PostgreSQL or MySQL syntax, and it supports not only CSV and TSV formats, and a few other. Tested on -current/amd64 -- wbr, Kirill
trdsql.tgz
Description: Binary data