-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority:mediumShould be done soonShould be done soonsize:xsTrivial — less than 1 hourTrivial — less than 1 hourstatus:readyRefined and ready for sprint selectionRefined and ready for sprint selectiontype:featureNew functionalityNew functionality
Milestone
Description
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,statusAcceptance Criteria
-
--columnsreads only the CSV header row, prints each column name on its own line to stdout, and exits 0 - Inferred type is optionally shown with
--columns --verbose:id INTEGER,amount REAL,region TEXT -
--columnsis mutually exclusive with a query argument (print usage error if both provided) - Works with
--delimiterand--tsvflags - Documented in
--help, README.md Flags table, anddocs/sql-pipe.1.scd - Test: correct column list printed, correct exit code
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:mediumShould be done soonShould be done soonsize:xsTrivial — less than 1 hourTrivial — less than 1 hourstatus:readyRefined and ready for sprint selectionRefined and ready for sprint selectiontype:featureNew functionalityNew functionality