pub struct QueryResponse {
pub status: ResponseStatus,
pub results: Vec<QueryResult>,
pub took: Option<f64>,
pub error: Option<ErrorDetail>,
}Expand description
Contains query results, execution metadata, and optional error information. Matches the server’s SqlResponse structure.
Fields§
§status: ResponseStatusQuery execution status (“success” or “error”)
results: Vec<QueryResult>Array of result sets, one per executed statement
took: Option<f64>Query execution time in milliseconds (with fractional precision)
error: Option<ErrorDetail>Error details if status is “error”
Implementations§
Source§impl QueryResponse
impl QueryResponse
Sourcepub fn is_token_expired(&self) -> bool
pub fn is_token_expired(&self) -> bool
Returns true if the error is a TOKEN_EXPIRED error.
Sourcepub fn rows(&self) -> Vec<Vec<KalamCellValue>>
pub fn rows(&self) -> Vec<Vec<KalamCellValue>>
Returns the first result’s rows, if any (as arrays).
Sourcepub fn rows_as_maps(&self) -> Vec<HashMap<String, KalamCellValue>>
pub fn rows_as_maps(&self) -> Vec<HashMap<String, KalamCellValue>>
Returns the first result’s rows as HashMaps (column name → value).
Sourcepub fn first_row_as_map(&self) -> Option<HashMap<String, KalamCellValue>>
pub fn first_row_as_map(&self) -> Option<HashMap<String, KalamCellValue>>
Returns the first row as a HashMap, if any.
Sourcepub fn column_index(&self, column_name: &str) -> Option<usize>
pub fn column_index(&self, column_name: &str) -> Option<usize>
Get column index by name from schema.
Sourcepub fn get_value(&self, column_name: &str) -> Option<KalamCellValue>
pub fn get_value(&self, column_name: &str) -> Option<KalamCellValue>
Get a value from the first row by column name.
Sourcepub fn get_i64(&self, column_name: &str) -> Option<i64>
pub fn get_i64(&self, column_name: &str) -> Option<i64>
Get an i64 value from the first row by column name.
Handles both numeric values and string-encoded integers (for Int64 precision). The backend serializes Int64 as strings to preserve precision in JSON.
Sourcepub fn get_string(&self, column_name: &str) -> Option<String>
pub fn get_string(&self, column_name: &str) -> Option<String>
Get a string value from the first row by column name.
Trait Implementations§
Source§impl Clone for QueryResponse
impl Clone for QueryResponse
Source§fn clone(&self) -> QueryResponse
fn clone(&self) -> QueryResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more