pub struct SqlxRowRef { /* private fields */ }Expand description
A driver-agnostic decoded row produced by the sqlx engine. Holds owned values keyed by column name so callers can access them after the row itself has been dropped.
Implementations§
Source§impl SqlxRowRef
impl SqlxRowRef
Sourcepub fn from_sqlx(row: &SqlxRow) -> Result<Self, RowError>
pub fn from_sqlx(row: &SqlxRow) -> Result<Self, RowError>
Decode a raw sqlx row into a driver-agnostic SqlxRowRef.
Returns RowError::TypeConversion if any column’s wire type
cannot be decoded into a [Value] — a column is never silently
recorded as NULL unless it actually is NULL.
Trait Implementations§
Source§impl RowRef for SqlxRowRef
impl RowRef for SqlxRowRef
Source§fn get_string(&self, c: &str) -> Result<String, RowError>
fn get_string(&self, c: &str) -> Result<String, RowError>
Override the trait default (get_str + to_string) so
String-typed model fields can read columns decoded into a
non-text variant — most importantly String @db.Uuid schema
fields over native UUID columns, mirroring PgRow::get_string
in prax-postgres. Datetimes stringify as RFC 3339; decimals and
JSON use their canonical text forms.
Source§fn is_null(&self, c: &str) -> Result<bool, RowError>
fn is_null(&self, c: &str) -> Result<bool, RowError>
Override the trait default (which delegates to get_str_opt and
therefore errors on any non-text, non-null cell — I64, F64,
Bool, Bytes, …) with a direct snapshot probe. This is what the
blanket impl<T: FromColumn> FromColumn for Option<T> calls to
short-circuit nullable columns, so Option<i32> = Some(5) must
get Ok(false) here rather than a “not text” failure. Mirrors
the NullProbe override on PgRow in prax-postgres.
Source§fn get_i32_opt(&self, c: &str) -> Result<Option<i32>, RowError>
fn get_i32_opt(&self, c: &str) -> Result<Option<i32>, RowError>
Source§fn get_i64_opt(&self, c: &str) -> Result<Option<i64>, RowError>
fn get_i64_opt(&self, c: &str) -> Result<Option<i64>, RowError>
Source§fn get_f64_opt(&self, c: &str) -> Result<Option<f64>, RowError>
fn get_f64_opt(&self, c: &str) -> Result<Option<f64>, RowError>
Source§fn get_bool_opt(&self, c: &str) -> Result<Option<bool>, RowError>
fn get_bool_opt(&self, c: &str) -> Result<Option<bool>, RowError>
Source§fn get_str(&self, c: &str) -> Result<&str, RowError>
fn get_str(&self, c: &str) -> Result<&str, RowError>
Source§fn get_str_opt(&self, c: &str) -> Result<Option<&str>, RowError>
fn get_str_opt(&self, c: &str) -> Result<Option<&str>, RowError>
Source§fn get_string_opt(&self, c: &str) -> Result<Option<String>, RowError>
fn get_string_opt(&self, c: &str) -> Result<Option<String>, RowError>
Source§fn get_bytes(&self, c: &str) -> Result<&[u8], RowError>
fn get_bytes(&self, c: &str) -> Result<&[u8], RowError>
Source§fn get_bytes_opt(&self, c: &str) -> Result<Option<&[u8]>, RowError>
fn get_bytes_opt(&self, c: &str) -> Result<Option<&[u8]>, RowError>
fn get_datetime_utc(&self, c: &str) -> Result<DateTime<Utc>, RowError>
fn get_datetime_utc_opt( &self, c: &str, ) -> Result<Option<DateTime<Utc>>, RowError>
fn get_naive_datetime(&self, c: &str) -> Result<NaiveDateTime, RowError>
fn get_naive_datetime_opt( &self, c: &str, ) -> Result<Option<NaiveDateTime>, RowError>
fn get_naive_date(&self, c: &str) -> Result<NaiveDate, RowError>
fn get_naive_date_opt(&self, c: &str) -> Result<Option<NaiveDate>, RowError>
fn get_naive_time(&self, c: &str) -> Result<NaiveTime, RowError>
fn get_naive_time_opt(&self, c: &str) -> Result<Option<NaiveTime>, RowError>
fn get_uuid(&self, c: &str) -> Result<Uuid, RowError>
fn get_uuid_opt(&self, c: &str) -> Result<Option<Uuid>, RowError>
fn get_json(&self, c: &str) -> Result<Value, RowError>
fn get_json_opt(&self, c: &str) -> Result<Option<Value>, RowError>
fn get_decimal(&self, c: &str) -> Result<Decimal, RowError>
fn get_decimal_opt(&self, c: &str) -> Result<Option<Decimal>, RowError>
Auto Trait Implementations§
impl Freeze for SqlxRowRef
impl RefUnwindSafe for SqlxRowRef
impl Send for SqlxRowRef
impl Sync for SqlxRowRef
impl Unpin for SqlxRowRef
impl UnsafeUnpin for SqlxRowRef
impl UnwindSafe for SqlxRowRef
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> 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> 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