Description
When working with an unfamiliar CSV file, users often need to know what columns are available before writing a query. Currently they have to use head -1 or --header with a SELECT *. A dedicated --columns flag reads only the header row and exits, making it composable with other tools.
Example
$ cat sales.csv | sql-pipe --columns
id
region
amount
date
status
# Use in scripts:
$ COLS=$(cat sales.csv | sql-pipe --columns | paste -sd,)
# → id,region,amount,date,status
Acceptance Criteria
Notes
- Only the header row needs to be read — no need to load data rows
- Column type annotation requires reading the first 100 rows for inference; document this overhead
Description
When working with an unfamiliar CSV file, users often need to know what columns are available before writing a query. Currently they have to use
head -1or--headerwith aSELECT *. A dedicated--columnsflag reads only the header row and exits, making it composable with other tools.Example
Acceptance Criteria
--columnsreads only the CSV header row, prints each column name on its own line to stdout, and exits 0--columns --verbose:id INTEGER,amount REAL,region TEXT--columnsis mutually exclusive with a query argument (print usage error if both provided)--delimiterand--tsvflags--help, README.md Flags table, anddocs/sql-pipe.1.scdNotes