-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority:highMust be in the next sprintMust be in the next sprintsize:sSmall — 1 to 4 hoursSmall — 1 to 4 hoursstatus:readyRefined and ready for sprint selectionRefined and ready for sprint selectiontype:featureNew functionalityNew functionality
Milestone
Description
Description
sql-pipe loads the entire CSV into an in-memory SQLite database. A malformed input or an accidental pipe of a 10M-row file can exhaust RAM with no warning. A --max-rows flag gives users a safe fast-fail mechanism.
Example
$ cat huge.csv | sql-pipe --max-rows 100000 'SELECT COUNT(*) FROM t'
error: input exceeds --max-rows limit (100000 rows)Acceptance Criteria
- Add
--max-rows <n>flag (integer, must be > 0) - After inserting
nrows, stop reading stdin and exit with code 1 and a clear error message to stderr:error: input exceeds --max-rows limit (<n> rows) -
--max-rows 0is an error (print usage error) - Flag is documented in
--helpoutput, README.md Flags table, anddocs/sql-pipe.1.scd - Tests cover: normal operation (under limit), limit hit (correct error + exit code)
Notes
- Counter is incremented in the CSV insert loop in
src/main.zig - Exit code 1 (usage/input error) is appropriate; consider a dedicated code if it helps scripting
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:highMust be in the next sprintMust be in the next sprintsize:sSmall — 1 to 4 hoursSmall — 1 to 4 hoursstatus:readyRefined and ready for sprint selectionRefined and ready for sprint selectiontype:featureNew functionalityNew functionality