csvql

command module
v0.0.0-...-7c0fc5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

csvQL

SQL for CSV and Excel files, in the terminal.

Point it at a CSV file, a folder of them, or an .xlsx workbook, and query them with SQL. Every file (and every sheet) becomes a table named after it.

Install

Requires Go 1.25 or newer.

go install github.com/chazzychouse/csvql@latest

Use

csvql shell sales.csv          # interactive shell on one file
csvql shell ./data             # every CSV in a folder, one table each
csvql shell report.xlsx        # every sheet of a workbook
csvql query "SELECT city, sqft FROM stores.csv WHERE sqft > 1600"
csvql schema stores.csv        # column names and inferred types
In the shell
Key Does
/ Write a SQL query (autocompletes tables, columns and values; Tab accepts)
: Run a command (below)
h j k l or arrows Move around the grid
gg / G, 0 / $ First or last row, first or last column
Ctrl+D / Ctrl+U Half a page down or up
Tab Toggle the side panel: the selected cell, the schema, the tables
1–9 Switch table
R Back to the full table after a query
q Quit
Command Does
:unpivot Turn date columns (Jan 2026, 2026-01-15, …) into date and value rows
:reset Undo :unpivot
:schema Open the side panel on the schema
:header N Reload the table using row N as its header
:table NAME Switch to a table by name

WHERE supports comparisons, AND/OR/NOT, IS [NOT] NULL and BETWEEN. Column types are inferred from the data, so numbers compare as numbers. Headers become SQL-friendly names: Jan 2026 is jan_2026.

Develop

go test ./...
go build .

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
csv
tui
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL