Description
Add markdown (alias md) to the output format list. Render SQL query results as a GitHub-Flavored Markdown table.
sql-pipe data.csv -O markdown 'SELECT region, SUM(amount) FROM t GROUP BY region'
# | region | SUM(amount) |
# |--------|-------------|
# | East | 250 |
# | West | 250 |
Motivation
Markdown tables are the standard format for embedding data in documentation, READMEs, GitHub issues, PRs, Slack/Teams messages, and Jupyter notebooks. Currently users must use --table + manual cleanup or pipe through another tool. This is the most-requested output format for CLI tools that produce tabular data.
Acceptance Criteria
Implementation Notes
- The two-pass approach from
table.zig (compute widths, then print) can be reused almost directly
- About 40-50 lines of new code
- Markdown doesn't strictly need visual alignment (pipes are the structure), but aligned output looks better
Description
Add
markdown(aliasmd) to the output format list. Render SQL query results as a GitHub-Flavored Markdown table.Motivation
Markdown tables are the standard format for embedding data in documentation, READMEs, GitHub issues, PRs, Slack/Teams messages, and Jupyter notebooks. Currently users must use
--table+ manual cleanup or pipe through another tool. This is the most-requested output format for CLI tools that produce tabular data.Acceptance Criteria
markdownto theOutputFormatenum insrc/format.zigtable.zignumeric detection)-O mdworks as a shorthand alias--header(always include header for markdown)Implementation Notes
table.zig(compute widths, then print) can be reused almost directly