pub struct QueryResult {
pub columns: Vec<String>,
pub rows: Vec<Vec<Value>>,
pub rows_affected: u64,
}Expand description
The result of executing a compiled SQL query.
Contains the column names, the returned rows, and the count of
rows affected (useful for DML statements such as INSERT,
UPDATE, or DELETE).
§Examples
use vlorql_core::execute::QueryResult;
let result = QueryResult {
columns: vec!["id".to_string(), "name".to_string()],
rows: vec![
vec![serde_json::json!(1), serde_json::json!("Alice")],
vec![serde_json::json!(2), serde_json::json!("Bob")],
],
rows_affected: 2,
};
assert_eq!(result.columns.len(), 2);
assert_eq!(result.rows.len(), 2);Fields§
§columns: Vec<String>The column names in the order they appear in the result set.
rows: Vec<Vec<Value>>The data rows, each element positionally matching columns.
rows_affected: u64The number of rows affected by the query.
For SELECT queries this is typically the row count of the
result set; for DML statements it reflects the number of
modified rows.
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§impl Debug for QueryResult
impl Debug for QueryResult
Source§impl<'de> Deserialize<'de> for QueryResult
impl<'de> Deserialize<'de> for QueryResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for QueryResult
impl PartialEq for QueryResult
Source§impl Serialize for QueryResult
impl Serialize for QueryResult
impl StructuralPartialEq for QueryResult
Auto Trait Implementations§
impl Forget for QueryResult
impl Freeze for QueryResult
impl Move for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnsafeUnpin for QueryResultwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Vec<Value>>: UnsafeUnpin,
impl UnwindSafe for QueryResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request