feat: add --validate mode to check CSV syntax without running a query#130
Merged
feat: add --validate mode to check CSV syntax without running a query#130
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--validateflag that parses the entire CSV/TSV input without executing any SQL queryOK: <n> rows, <m> columns (<col> <TYPE>, ...)to stdout and exits 0--delimiter,--tsv,--no-type-inferenceChanges
src/main.zig: newValidateArgsstruct,validatevariant inArgsResult,ValidateWithQueryerror, fullrunValidate()implementation with type inference, thousands-separated row count, and column type summarybuild.zig: 4 new integration tests (75–78) — valid CSV, malformed CSV exits 2, custom delimiter, conflict with queryREADME.md: new row in the flags table for--validatedocs/sql-pipe.1.scd: new*--validate*entry in OPTIONS sectionAcceptance 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.scdCloses #88