feat: add --sample <n> flag for quick data preview with schema#131
Merged
Conversation
- Add SampleWithOutput error: --sample --output now exits 1 with error instead of silently discarding the output file path - Fix stdout write errors in runSample to call fatal instead of std.log.err, preventing silent truncation with exit code 0 - Add type_inference field to SampleArgs so --no-type-inference is respected in --sample mode (shows all columns as TEXT) - Use @max for max_col_width computation (style) - Clarify help text ambiguity around mutual exclusions - Add 10 integration tests (85-94) covering all --sample acceptance criteria: row count, schema on stderr, type inference, TSV input, error cases and edge cases
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
--sample [<n>]flag that prints a#-prefixed schema block to stderr and the firstnCSV rows (default 10) to stdout — combining--columns --verbose+SELECT * FROM t LIMIT ninto a single invocation--header; compatible with--delimiter/--tsv; mutually exclusive with--json,--columns,--validate, and a query argumentmax(100, n)rows before emitting output; exits after printingnrows without reading the full input--help,README.md, anddocs/sql-pipe.1.scdExample
Closes #89