Skip to content

feat: add HTML table output format (-O html)#188

Merged
vmvarela merged 1 commit into
masterfrom
issue-173/html-output-format
Jul 3, 2026
Merged

feat: add HTML table output format (-O html)#188
vmvarela merged 1 commit into
masterfrom
issue-173/html-output-format

Conversation

@vmvarela

@vmvarela vmvarela commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Description

Add html to the output format list. Render SQL query results as an HTML <table> element.

sql-pipe data.csv -O html "SELECT * FROM t LIMIT 5"

Changes

  • src/format.zig: html variant in OutputFormat, html_class in WriteOpts, streaming HTML writer functions wired into OutputWriter.begin/writeRow/end, .html added to col_names collection
  • src/args.zig: html_class in ParsedArgs, --html-class flag parsing, header guard relaxed for HTML format, help text updated
  • src/main.zig: html_class threaded through execQuery, error messages updated (MissingHtmlClassValue)
  • README.md: -O html in output format list, --html-class in flags table
  • docs/sql-pipe.1.scd: html in format list, --html-class option documented, HTML examples added
  • build.zig: 8 integration tests (basic, header, class, null, escaping, null-value, missing class value, attribute escaping)

Closes

Closes #173

Add html to the output format list. Render SQL query results as an
HTML <table> element with optional <thead> and CSS class support.

- Add html variant to OutputFormat enum
- Implement streaming HTML writer in OutputWriter (begin/writeRow/end)
- HTML-escape all cell values, column names, and class attributes
  via writeXmlEscaped (reused from xml.zig)
- NULL values render as empty cells, custom via --null-value
- --header controls <thead> section
- --html-class <class> sets CSS class on <table>
- Update README.md flags table
- Update docs/sql-pipe.1.scd (options + examples)
- 8 integration tests

Closes #173
@vmvarela vmvarela changed the title Add HTML table output format (-O html) feat: add HTML table output format (-O html) Jul 3, 2026
@github-actions github-actions Bot added the type:feature New functionality label Jul 3, 2026
@vmvarela vmvarela merged commit 1722851 into master Jul 3, 2026
6 checks passed
@vmvarela vmvarela deleted the issue-173/html-output-format branch July 3, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HTML table output format (-O html)

1 participant