Skip to main content

Module query_results

Module query_results 

Source
Expand description

Query result table renderable for beautiful result display.

Provides a table specifically designed for displaying query results with rich formatting in styled mode and multiple plain text formats for agent compatibility.

§Example

use sqlmodel_console::renderables::{QueryResultTable, PlainFormat};

let table = QueryResultTable::new()
    .title("Query Results")
    .columns(vec!["id", "name", "email"])
    .row(vec!["1", "Alice", "alice@example.com"])
    .row(vec!["2", "Bob", "bob@example.com"])
    .timing_ms(12.34)
    .max_width(80);

// Plain mode output (pipe-delimited)
println!("{}", table.render_plain());

// Or use a different format
println!("{}", table.render_plain_format(PlainFormat::Csv));

Structs§

Cell
A cell in the query result table.
QueryResultTable
A table for displaying query results.

Enums§

PlainFormat
Plain text output format for query results.
ValueType
SQL value type for cell coloring.

Type Aliases§

QueryResults
Alias for QueryResultTable for simpler API.