pub struct SQLResult {
pub kind: SQLResultKind,
pub command_tag: Option<String>,
pub columns: Vec<String>,
pub column_types: Vec<Option<ColumnType>>,
pub rows: Vec<ResultRow>,
pub affected_rows: u64,
/* private fields */
}Fields§
§kind: SQLResultKindDescriptor presence, including zero-column and empty row results.
command_tag: Option<String>PostgreSQL command completion, including its command-specific row count. Execution sets this from the command that actually ran; row constructors leave it absent because rows alone do not identify a SQL command.
columns: Vec<String>Column order as the SELECT clause specified.
column_types: Vec<Option<ColumnType>>Statically bound SQL type for each output position. A missing entry represents a type that has not yet been resolved, never a type inferred from the first runtime value.
rows: Vec<ResultRow>One row per result document, with the named columns in
columns. Extra columns from _score etc. are included here
too.
affected_rows: u64Number of rows touched by an INSERT / UPDATE / DELETE.
Implementations§
Source§impl SQLResult
impl SQLResult
Sourcepub fn with_command_tag(self, tag: impl Into<String>) -> Self
pub fn with_command_tag(self, tag: impl Into<String>) -> Self
Attach the completion chosen by the executing SQL command.
pub fn empty() -> Self
pub fn from_rows(columns: Vec<String>, rows: Vec<ResultRow>) -> Self
pub fn from_rows_with_positions( columns: Vec<String>, rows: Vec<ResultRow>, positional_rows: Option<Vec<Vec<Value>>>, ) -> Self
pub fn from_typed_rows_with_positions( columns: Vec<String>, column_types: Vec<Option<ColumnType>>, rows: Vec<ResultRow>, positional_rows: Option<Vec<Vec<Value>>>, ) -> Self
Sourcepub fn value_at(&self, row: usize, column: usize) -> Option<&Value>
pub fn value_at(&self, row: usize, column: usize) -> Option<&Value>
Return a result value by row and output-column position.
Positional access is the canonical way to distinguish repeated output labels. Named rows remain available for compatibility with existing callers.
pub fn from_affected(affected: u64) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SQLResult
impl RefUnwindSafe for SQLResult
impl Send for SQLResult
impl Sync for SQLResult
impl Unpin for SQLResult
impl UnsafeUnpin for SQLResult
impl UnwindSafe for SQLResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more