feat: add HTML table output format (-O html)#188
Merged
Conversation
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
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.
Description
Add
htmlto 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
htmlvariant inOutputFormat,html_classinWriteOpts, streaming HTML writer functions wired intoOutputWriter.begin/writeRow/end,.htmladded tocol_namescollectionhtml_classinParsedArgs,--html-classflag parsing, header guard relaxed for HTML format, help text updatedhtml_classthreaded throughexecQuery, error messages updated (MissingHtmlClassValue)-O htmlin output format list,--html-classin flags tablehtmlin format list,--html-classoption documented, HTML examples addedCloses
Closes #173