-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority:mediumShould be done soonShould be done soonsize:sSmall — 1 to 4 hoursSmall — 1 to 4 hoursstatus:readyRefined and ready for sprint selectionRefined and ready for sprint selectiontype:featureNew functionalityNew functionality
Description
Description
Users working with untrusted or generated CSV often want to verify the file is well-formed before running queries. Today this requires piping through a no-op query (SELECT 1) and interpreting exit codes. A dedicated --validate flag makes the intent explicit and gives better error output.
Example
# Valid file
$ cat good.csv | sql-pipe --validate
OK: 1,234 rows, 5 columns (id INTEGER, name TEXT, amount REAL, region TEXT, date TEXT)
$ echo $?
0
# Invalid file
$ cat bad.csv | sql-pipe --validate
error: CSV parse error at row 42: unclosed quoted field
$ echo $?
2Acceptance Criteria
-
--validateparses the entire CSV input and prints a summary to stdout on success:OK: <n> rows, <m> columns (<col> <TYPE>, ...) - On parse error, print the existing CSV error message (row number + description) and exit 2
-
--validatedoes not run any SQL query — no query argument required or used - Works with
--delimiter,--tsv,--no-type-inference - Exit 0 on success, exit 2 on CSV error
- Documented in
--help, README.md, anddocs/sql-pipe.1.scd - Tests: valid CSV exits 0 with correct summary; malformed CSV exits 2 with row number
Notes
- Reuses the existing CSV parser and type inference pipeline; skip
sqlite3_execentirely - The column type summary requires running type inference (first 100 rows)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:mediumShould be done soonShould be done soonsize:sSmall — 1 to 4 hoursSmall — 1 to 4 hoursstatus:readyRefined and ready for sprint selectionRefined and ready for sprint selectiontype:featureNew functionalityNew functionality