Summary
Add a --markdown flag to output query results as Markdown tables.
Use Case
- Copy/paste results directly into GitHub issues, PRs, or documentation
- Generate documentation from database queries
- Integration with documentation pipelines
Proposed Syntax
sqlcmd -S server -Q "SELECT * FROM users" --markdown
Example Output
| id | name | email |
|----|------|-------|
| 1 | Alice | alice@example.com |
| 2 | Bob | bob@example.com |
Implementation Notes
- Could leverage existing formatter infrastructure in
pkg/sqlcmd/formatter.go
- Similar approach to how XML output is handled
Summary
Add a
--markdownflag to output query results as Markdown tables.Use Case
Proposed Syntax
sqlcmd -S server -Q "SELECT * FROM users" --markdownExample Output
Implementation Notes
pkg/sqlcmd/formatter.go