xo / usql

Universal command-line interface for SQL databases
MIT License
9.07k stars 352 forks source link

Markdown table output #482

Open bersace opened 1 month ago

bersace commented 1 month ago

Hi,

Thanks for usql and dburl, very useful !

When pasting SQL query in a GitLab or GitHub field, it would be cool to use markdown table instead of backticks. What do you think of a markdown output format ?

Something like -M, --markdown.

$ usql --markdown $DSN < query.sql
| COLUMN | NAME |
|--------|------|
| FOO    | BAR  |
| TOTO   | TITI |
| PIF    | PAF  |
$

References: https://www.markdownguide.org/extended-syntax/#tables

Regards, Étienne