feat: add --max-rows flag to limit input size#109
Merged
Conversation
- Add --max-rows <n> CLI option; exit with error if input exceeds the limit - Migrate to Zig 0.16.0 std.Io API (File.reader/writer, takeByte, flush) - Fix CsvReader: non-generic struct using *std.Io.Reader to avoid fieldParentPtr breakage when copying interface value - Flush stdout/stderr before all process.exit() calls to drain buffered writers
- Restore sqlite_static doc comment and ParsedArgs field doc comments - Add max_rows field doc comment to ParsedArgs - Fix --max-rows help text wording - Migrate remaining 6 anytype writer params to *std.Io.Writer - Fix csv.zig method indentation via zig fmt - Add integration tests 23-25 (= form, non-numeric value, --no-type-inference path)
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.
Closes #82
Summary
--max-rows <n>flag; after insertingnrows, stops reading and exits with code 1 anderror: input exceeds --max-rows limit (<n> rows)on stderr--max-rows 0or non-integer value prints a usage error--help,README.md, anddocs/sql-pipe.1.scd--max-rows 0validationZig 0.16.0 migration (required to build)
std.io→std.IoAPI throughout (File.reader/File.writer,takeByte, buffered flush)CsvReaderrefactored from generic to concrete*std.Io.Readerto avoid@fieldParentPtrbreakage when copying theinterfacevalue out ofFile.Readerprocess.exit()callbuild.zig.zonminimum_zig_versionand CI/release workflows bumped to0.16.0