(
result: &QueryResult,
format: &OutputFormat,
no_header: bool,
writer: &mut W,
)
| 6 | use tabled::settings::{Style, Width}; |
| 7 | |
| 8 | pub fn format_output<W: Write>( |
| 9 | result: &QueryResult, |
| 10 | format: &OutputFormat, |
| 11 | no_header: bool, |
| 12 | writer: &mut W, |
| 13 | ) -> Result<()> { |
| 14 | match format { |
| 15 | OutputFormat::Table => format_table(result, no_header, writer), |
| 16 | OutputFormat::Json => format_json(result, writer), |
| 17 | OutputFormat::Jsonl => format_jsonl(result, writer), |
| 18 | OutputFormat::Csv => format_csv(result, no_header, writer), |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | fn format_table<W: Write>(result: &QueryResult, no_header: bool, writer: &mut W) -> Result<()> { |
| 23 | if result.is_empty() { |
no test coverage detected