pub struct SqlRow {
pub columns: Vec<SqlColumn>,
}Expand description
A row of named columns returned by a raw SQL query.
Fields§
§columns: Vec<SqlColumn>Implementations§
Source§impl SqlRow
impl SqlRow
Sourcepub fn get(&self, name: &str) -> Option<&SqlValue>
pub fn get(&self, name: &str) -> Option<&SqlValue>
Look up a column value by name, returning None if absent.
Sourcepub fn text(&self, name: &str) -> Result<&str, SqlColumnError>
pub fn text(&self, name: &str) -> Result<&str, SqlColumnError>
Read text, refusing NULL, absence, and other SQL variants.
Sourcepub fn i64(&self, name: &str) -> Result<i64, SqlColumnError>
pub fn i64(&self, name: &str) -> Result<i64, SqlColumnError>
Read an integer, refusing NULL, absence, and other SQL variants, including Float.
Sourcepub fn opt_text(&self, name: &str) -> Result<Option<&str>, SqlColumnError>
pub fn opt_text(&self, name: &str) -> Result<Option<&str>, SqlColumnError>
Read nullable text, refusing an absent column or another SQL variant.
Sourcepub fn opt_i64(&self, name: &str) -> Result<Option<i64>, SqlColumnError>
pub fn opt_i64(&self, name: &str) -> Result<Option<i64>, SqlColumnError>
Read a nullable integer, refusing an absent column or another SQL variant.
Sourcepub fn opt_text_or_absent(
&self,
name: &str,
) -> Result<Option<&str>, SqlColumnError>
pub fn opt_text_or_absent( &self, name: &str, ) -> Result<Option<&str>, SqlColumnError>
Read nullable text, treating absence as NULL while refusing other SQL variants.
Sourcepub fn opt_i64_or_absent(
&self,
name: &str,
) -> Result<Option<i64>, SqlColumnError>
pub fn opt_i64_or_absent( &self, name: &str, ) -> Result<Option<i64>, SqlColumnError>
Read a nullable integer, treating absence as NULL while refusing other SQL variants.
Sourcepub fn uuid(&self, name: &str) -> Result<Uuid, SqlColumnError>
pub fn uuid(&self, name: &str) -> Result<Uuid, SqlColumnError>
Read a native UUID or parse UUID text, refusing NULL, absence, invalid UUID text, and other SQL variants.
Sourcepub fn opt_uuid(&self, name: &str) -> Result<Option<Uuid>, SqlColumnError>
pub fn opt_uuid(&self, name: &str) -> Result<Option<Uuid>, SqlColumnError>
Read a nullable UUID with the same accepted representations as Self::uuid.
An absent column, invalid UUID text, or another SQL variant is refused.
Sourcepub fn f64(&self, name: &str) -> Result<f64, SqlColumnError>
pub fn f64(&self, name: &str) -> Result<f64, SqlColumnError>
Read a Float unchanged or convert an Integer using Rust’s as f64
rounding. Non-finite Floats are preserved; NULL, absence, and other
SQL variants (including numeric text) are refused.
Sourcepub fn opt_f64(&self, name: &str) -> Result<Option<f64>, SqlColumnError>
pub fn opt_f64(&self, name: &str) -> Result<Option<f64>, SqlColumnError>
Read a nullable number using Self::f64, refusing an absent column
or another SQL variant.
Sourcepub fn text_or_none(&self, name: &str) -> Option<&str>
pub fn text_or_none(&self, name: &str) -> Option<&str>
Read text, treating absence, NULL, and every other SQL variant as None.
Sourcepub fn i64_or_none(&self, name: &str) -> Option<i64>
pub fn i64_or_none(&self, name: &str) -> Option<i64>
Read an integer, treating absence, NULL, and every other SQL variant
(including Float) as None.