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 $?
2
Acceptance Criteria
Notes
- Reuses the existing CSV parser and type inference pipeline; skip
sqlite3_exec entirely
- The column type summary requires running type inference (first 100 rows)
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--validateflag makes the intent explicit and gives better error output.Example
Acceptance Criteria
--validateparses the entire CSV input and prints a summary to stdout on success:OK: <n> rows, <m> columns (<col> <TYPE>, ...)--validatedoes not run any SQL query — no query argument required or used--delimiter,--tsv,--no-type-inference--help, README.md, anddocs/sql-pipe.1.scdNotes
sqlite3_execentirely