I built `sql-pipe` because I often need to filter or aggregate CSV data in the terminal, and I found the existing options lacking:
- `awk` syntax effectively requires learning a new language for complex logic.
- Pandas/Python scripts are heavy and slow to spin up for one-liners.
- The standard `sqlite3` CLI requires multiple commands (.mode csv, .import) before you can run a query.
sql-pipe converts stdin (CSV/TSV) into an in-memory SQLite table named `t` on the fly, auto-detects column types (so you can sum/avg integers directly), and outputs the result back to stdout.
It's written in Zig, statically links SQLite (zero dependencies), and is cross-compiled for Linux/macOS/Windows.
Example usage:
curl -s https://example.com/data.csv | sql-pipe "SELECT region, SUM(revenue) FROM t GROUP BY 1 ORDER BY 2 DESC"
Happy to answer any questions about the Zig implementation or the SQLite integration!
ifh-hn•1h ago
Did you try nushell?
cyrusradfar•2h ago
Cool project, congrats on making it to Show. It's always a nice moment whether or not the community notices.
This is off-topic, but I'm curious on your interest in Zig and experience getting started. I haven't explored the language, yet. Currently, I'm focused on absorbing the rust ecosystem a bit better.
vmvarela•2h ago
I built `sql-pipe` because I often need to filter or aggregate CSV data in the terminal, and I found the existing options lacking: - `awk` syntax effectively requires learning a new language for complex logic. - Pandas/Python scripts are heavy and slow to spin up for one-liners. - The standard `sqlite3` CLI requires multiple commands (.mode csv, .import) before you can run a query.
sql-pipe converts stdin (CSV/TSV) into an in-memory SQLite table named `t` on the fly, auto-detects column types (so you can sum/avg integers directly), and outputs the result back to stdout.
It's written in Zig, statically links SQLite (zero dependencies), and is cross-compiled for Linux/macOS/Windows.
Example usage: curl -s https://example.com/data.csv | sql-pipe "SELECT region, SUM(revenue) FROM t GROUP BY 1 ORDER BY 2 DESC"
The repo is here: https://github.com/vmvarela/sql-pipe
Happy to answer any questions about the Zig implementation or the SQLite integration!
ifh-hn•1h ago