pub type RowMap = indexmap::IndexMap<String, serde_json::Value>;
#[derive(Debug, Clone)]
pub struct QueryResult {
pub rows: Vec<RowMap>,
pub row_count: usize,
pub sql: String,
}
impl QueryResult {
pub fn new(rows: Vec<RowMap>, sql: String) -> Self {
let row_count = rows.len();
Self { rows, row_count, sql }
}
pub fn is_empty(&self) -> bool {
self.rows.is_empty()
}
}