iotdb/
pretty.rs

1use crate::rpc::TSExecuteStatementResp;
2use prettytable::{Cell, Row, Table};
3
4pub fn result_set(resp: TSExecuteStatementResp) {
5    let mut table = Table::new();
6
7    // Add Columns
8    let mut cells: Vec<Cell> = vec![];
9    for cell in resp.columns.unwrap() {
10        cells.push(Cell::new(cell.as_str()))
11    }
12    table.add_row(Row::new(cells));
13
14    //TODO Add values rows
15
16    // Print the table to stdout
17    table.printstd();
18}