Trait diesel::deserialize::FromSql
source · [−]pub trait FromSql<A, DB: Backend>: Sized {
fn from_sql(bytes: RawValue<'_, DB>) -> Result<Self>;
fn from_nullable_sql(bytes: Option<RawValue<'_, DB>>) -> Result<Self> { ... }
}
Expand description
Deserialize a single field of a given SQL type.
When possible, implementations of this trait should prefer to use an
existing implementation, rather than reading from bytes
. (For example, if
you are implementing this for an enum which is represented as an integer in
the database, prefer i32::from_sql(bytes)
(or the explicit form
<i32 as FromSql<Integer, DB>>::from_sql(bytes)
) over reading from bytes
directly)
Types which implement this trait should also have #[derive(FromSqlRow)]
Backend specific details
- For PostgreSQL, the bytes will be sent using the binary protocol, not text.
- For SQLite, the actual type of
DB::RawValue
is private API. All implementations of this trait must be written in terms of an existing primitive. - For MySQL, the value of
bytes
will depend on the return value oftype_metadata
for the given SQL type. SeeMysqlType
for details. - For third party backends, consult that backend’s documentation.
Examples
Most implementations of this trait will be defined in terms of an existing implementation.
#[repr(i32)]
#[derive(Debug, Clone, Copy, FromSqlRow)]
pub enum MyEnum {
A = 1,
B = 2,
}
impl<DB> FromSql<Integer, DB> for MyEnum
where
DB: Backend,
i32: FromSql<Integer, DB>,
{
fn from_sql(bytes: backend::RawValue<DB>) -> deserialize::Result<Self> {
match i32::from_sql(bytes)? {
1 => Ok(MyEnum::A),
2 => Ok(MyEnum::B),
x => Err(format!("Unrecognized variant {}", x).into()),
}
}
}
Required Methods
Provided Methods
fn from_nullable_sql(bytes: Option<RawValue<'_, DB>>) -> Result<Self>
fn from_nullable_sql(bytes: Option<RawValue<'_, DB>>) -> Result<Self>
A specialized variant of from_sql
for handling null values.
The default implementation returns an UnexpectedNullError
for
an encountered null value and calls Self::from_sql
otherwise
If your custom type supports null values you need to provide a custom implementation.
Implementations on Foreign Types
sourceimpl FromSql<Datetime, Mysql> for NaiveDateTime
Available on crate features chrono
and mysql_backend
only.
impl FromSql<Datetime, Mysql> for NaiveDateTime
chrono
and mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Timestamp, Mysql> for NaiveDateTime
Available on crate features chrono
and mysql_backend
only.
impl FromSql<Timestamp, Mysql> for NaiveDateTime
chrono
and mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Time, Mysql> for NaiveTime
Available on crate features chrono
and mysql_backend
only.
impl FromSql<Time, Mysql> for NaiveTime
chrono
and mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Date, Mysql> for NaiveDate
Available on crate features chrono
and mysql_backend
only.
impl FromSql<Date, Mysql> for NaiveDate
chrono
and mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Json, Mysql> for Value
Available on crate features mysql_backend
and serde_json
only.
impl FromSql<Json, Mysql> for Value
mysql_backend
and serde_json
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Numeric, Mysql> for BigDecimal
Available on crate features mysql_backend
and bigdecimal
only.
impl FromSql<Numeric, Mysql> for BigDecimal
mysql_backend
and bigdecimal
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<SmallInt, Mysql> for i16
Available on crate feature mysql_backend
only.
impl FromSql<SmallInt, Mysql> for i16
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Integer, Mysql> for i32
Available on crate feature mysql_backend
only.
impl FromSql<Integer, Mysql> for i32
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<BigInt, Mysql> for i64
Available on crate feature mysql_backend
only.
impl FromSql<BigInt, Mysql> for i64
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Float, Mysql> for f32
Available on crate feature mysql_backend
only.
impl FromSql<Float, Mysql> for f32
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Double, Mysql> for f64
Available on crate feature mysql_backend
only.
impl FromSql<Double, Mysql> for f64
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Text, Mysql> for String
Available on crate feature mysql_backend
only.
impl FromSql<Text, Mysql> for String
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Binary, Mysql> for Vec<u8>
Available on crate feature mysql_backend
only.
impl FromSql<Binary, Mysql> for Vec<u8>
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<TinyInt, Mysql> for i8
Available on crate feature mysql_backend
only.
impl FromSql<TinyInt, Mysql> for i8
mysql_backend
only.fn from_sql(value: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Unsigned<TinyInt>, Mysql> for u8
Available on crate feature mysql_backend
only.
impl FromSql<Unsigned<TinyInt>, Mysql> for u8
mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Unsigned<SmallInt>, Mysql> for u16
Available on crate feature mysql_backend
only.
impl FromSql<Unsigned<SmallInt>, Mysql> for u16
mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Unsigned<Integer>, Mysql> for u32
Available on crate feature mysql_backend
only.
impl FromSql<Unsigned<Integer>, Mysql> for u32
mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Unsigned<BigInt>, Mysql> for u64
Available on crate feature mysql_backend
only.
impl FromSql<Unsigned<BigInt>, Mysql> for u64
mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl FromSql<Bool, Mysql> for bool
Available on crate feature mysql_backend
only.
impl FromSql<Bool, Mysql> for bool
mysql_backend
only.fn from_sql(bytes: MysqlValue<'_>) -> Result<Self>
sourceimpl<T, ST> FromSql<Array<ST>, Pg> for Vec<T> where
T: FromSql<ST, Pg>,
Available on crate feature postgres_backend
only.
impl<T, ST> FromSql<Array<ST>, Pg> for Vec<T> where
T: FromSql<ST, Pg>,
postgres_backend
only.sourceimpl FromSql<Timestamp, Pg> for NaiveDateTime
Available on crate features chrono
and postgres_backend
only.
impl FromSql<Timestamp, Pg> for NaiveDateTime
chrono
and postgres_backend
only.sourceimpl FromSql<Timestamptz, Pg> for NaiveDateTime
Available on crate features chrono
and postgres_backend
only.
impl FromSql<Timestamptz, Pg> for NaiveDateTime
chrono
and postgres_backend
only.sourceimpl FromSql<Timestamptz, Pg> for DateTime<Utc>
Available on crate features chrono
and postgres_backend
only.
impl FromSql<Timestamptz, Pg> for DateTime<Utc>
chrono
and postgres_backend
only.sourceimpl FromSql<Timestamptz, Pg> for DateTime<Local>
Available on crate features chrono
and postgres_backend
only.
impl FromSql<Timestamptz, Pg> for DateTime<Local>
chrono
and postgres_backend
only.sourceimpl FromSql<Time, Pg> for NaiveTime
Available on crate features chrono
and postgres_backend
only.
impl FromSql<Time, Pg> for NaiveTime
chrono
and postgres_backend
only.sourceimpl FromSql<Date, Pg> for NaiveDate
Available on crate features chrono
and postgres_backend
only.
impl FromSql<Date, Pg> for NaiveDate
chrono
and postgres_backend
only.sourceimpl FromSql<Timestamp, Pg> for SystemTime
Available on crate feature postgres_backend
only.
impl FromSql<Timestamp, Pg> for SystemTime
postgres_backend
only.sourceimpl FromSql<Json, Pg> for Value
Available on crate features postgres_backend
and serde_json
only.
impl FromSql<Json, Pg> for Value
postgres_backend
and serde_json
only.sourceimpl FromSql<Jsonb, Pg> for Value
Available on crate features postgres_backend
and serde_json
only.
impl FromSql<Jsonb, Pg> for Value
postgres_backend
and serde_json
only.sourceimpl FromSql<Inet, Pg> for IpNetwork
Available on crate features postgres_backend
and network-address
only.
impl FromSql<Inet, Pg> for IpNetwork
postgres_backend
and network-address
only.sourceimpl FromSql<Cidr, Pg> for IpNetwork
Available on crate features postgres_backend
and network-address
only.
impl FromSql<Cidr, Pg> for IpNetwork
postgres_backend
and network-address
only.sourceimpl FromSql<Numeric, Pg> for BigDecimal
Available on crate features postgres_backend
and bigdecimal
only.
impl FromSql<Numeric, Pg> for BigDecimal
postgres_backend
and bigdecimal
only.sourceimpl FromSql<Text, Pg> for *const str
Available on crate feature postgres_backend
only.
impl FromSql<Text, Pg> for *const str
postgres_backend
only.The returned pointer is only valid for the lifetime to the argument of
from_sql
. This impl is intended for uses where you want to write a new
impl in terms of String
, but don’t want to allocate. We have to return a
raw pointer instead of a reference with a lifetime due to the structure of
FromSql
sourceimpl FromSql<Binary, Pg> for *const [u8]
Available on crate feature postgres_backend
only.
impl FromSql<Binary, Pg> for *const [u8]
postgres_backend
only.The returned pointer is only valid for the lifetime to the argument of
from_sql
. This impl is intended for uses where you want to write a new
impl in terms of Vec<u8>
, but don’t want to allocate. We have to return a
raw pointer instead of a reference with a lifetime due to the structure of
FromSql
sourceimpl<T, ST> FromSql<Range<ST>, Pg> for (Bound<T>, Bound<T>) where
T: FromSql<ST, Pg>,
Available on crate feature postgres_backend
only.
impl<T, ST> FromSql<Range<ST>, Pg> for (Bound<T>, Bound<T>) where
T: FromSql<ST, Pg>,
postgres_backend
only.sourceimpl<T0, ST0> FromSql<Record<(ST0,)>, Pg> for (T0,) where
T0: FromSql<ST0, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, ST0> FromSql<Record<(ST0,)>, Pg> for (T0,) where
T0: FromSql<ST0, Pg>,
postgres_backend
only.sourceimpl<T0, T1, ST0, ST1> FromSql<Record<(ST0, ST1)>, Pg> for (T0, T1) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, ST0, ST1> FromSql<Record<(ST0, ST1)>, Pg> for (T0, T1) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, ST0, ST1, ST2> FromSql<Record<(ST0, ST1, ST2)>, Pg> for (T0, T1, T2) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, ST0, ST1, ST2> FromSql<Record<(ST0, ST1, ST2)>, Pg> for (T0, T1, T2) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, ST0, ST1, ST2, ST3> FromSql<Record<(ST0, ST1, ST2, ST3)>, Pg> for (T0, T1, T2, T3) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, ST0, ST1, ST2, ST3> FromSql<Record<(ST0, ST1, ST2, ST3)>, Pg> for (T0, T1, T2, T3) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, ST0, ST1, ST2, ST3, ST4> FromSql<Record<(ST0, ST1, ST2, ST3, ST4)>, Pg> for (T0, T1, T2, T3, T4) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, ST0, ST1, ST2, ST3, ST4> FromSql<Record<(ST0, ST1, ST2, ST3, ST4)>, Pg> for (T0, T1, T2, T3, T4) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, ST0, ST1, ST2, ST3, ST4, ST5> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5)>, Pg> for (T0, T1, T2, T3, T4, T5) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, ST0, ST1, ST2, ST3, ST4, ST5> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5)>, Pg> for (T0, T1, T2, T3, T4, T5) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, ST0, ST1, ST2, ST3, ST4, ST5, ST6> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6)>, Pg> for (T0, T1, T2, T3, T4, T5, T6) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, ST0, ST1, ST2, ST3, ST4, ST5, ST6> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6)>, Pg> for (T0, T1, T2, T3, T4, T5, T6) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
T13: FromSql<ST13, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
T13: FromSql<ST13, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
T13: FromSql<ST13, Pg>,
T14: FromSql<ST14, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
T13: FromSql<ST13, Pg>,
T14: FromSql<ST14, Pg>,
postgres_backend
only.sourceimpl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14, ST15> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14, ST15)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
T13: FromSql<ST13, Pg>,
T14: FromSql<ST14, Pg>,
T15: FromSql<ST15, Pg>,
Available on crate feature postgres_backend
only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14, ST15> FromSql<Record<(ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, ST8, ST9, ST10, ST11, ST12, ST13, ST14, ST15)>, Pg> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where
T0: FromSql<ST0, Pg>,
T1: FromSql<ST1, Pg>,
T2: FromSql<ST2, Pg>,
T3: FromSql<ST3, Pg>,
T4: FromSql<ST4, Pg>,
T5: FromSql<ST5, Pg>,
T6: FromSql<ST6, Pg>,
T7: FromSql<ST7, Pg>,
T8: FromSql<ST8, Pg>,
T9: FromSql<ST9, Pg>,
T10: FromSql<ST10, Pg>,
T11: FromSql<ST11, Pg>,
T12: FromSql<ST12, Pg>,
T13: FromSql<ST13, Pg>,
T14: FromSql<ST14, Pg>,
T15: FromSql<ST15, Pg>,
postgres_backend
only.sourceimpl FromSql<Timestamp, Sqlite> for NaiveDateTime
Available on crate features sqlite
and chrono
only.
impl FromSql<Timestamp, Sqlite> for NaiveDateTime
sqlite
and chrono
only.sourceimpl FromSql<Timestamptz, Sqlite> for NaiveDateTime
Available on crate features sqlite
and chrono
only.
impl FromSql<Timestamptz, Sqlite> for NaiveDateTime
sqlite
and chrono
only.sourceimpl FromSql<Timestamptz, Sqlite> for DateTime<Utc>
Available on crate features sqlite
and chrono
only.
impl FromSql<Timestamptz, Sqlite> for DateTime<Utc>
sqlite
and chrono
only.sourceimpl FromSql<Timestamptz, Sqlite> for DateTime<Local>
Available on crate features sqlite
and chrono
only.
impl FromSql<Timestamptz, Sqlite> for DateTime<Local>
sqlite
and chrono
only.sourceimpl FromSql<Date, Sqlite> for String
Available on crate feature sqlite
only.
impl FromSql<Date, Sqlite> for String
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Time, Sqlite> for String
Available on crate feature sqlite
only.
impl FromSql<Time, Sqlite> for String
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Timestamp, Sqlite> for String
Available on crate feature sqlite
only.
impl FromSql<Timestamp, Sqlite> for String
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Timestamptz, Sqlite> for String
Available on crate feature sqlite
only.
impl FromSql<Timestamptz, Sqlite> for String
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Numeric, Sqlite> for BigDecimal
Available on crate features sqlite
and bigdecimal
only.
impl FromSql<Numeric, Sqlite> for BigDecimal
sqlite
and bigdecimal
only.fn from_sql(bytes: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Text, Sqlite> for *const str
Available on crate feature sqlite
only.
impl FromSql<Text, Sqlite> for *const str
sqlite
only.The returned pointer is only valid for the lifetime to the argument of
from_sql
. This impl is intended for uses where you want to write a new
impl in terms of String
, but don’t want to allocate. We have to return a
raw pointer instead of a reference with a lifetime due to the structure of
FromSql
fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Binary, Sqlite> for *const [u8]
Available on crate feature sqlite
only.
impl FromSql<Binary, Sqlite> for *const [u8]
sqlite
only.The returned pointer is only valid for the lifetime to the argument of
from_sql
. This impl is intended for uses where you want to write a new
impl in terms of Vec<u8>
, but don’t want to allocate. We have to return a
raw pointer instead of a reference with a lifetime due to the structure of
FromSql
fn from_sql(bytes: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<SmallInt, Sqlite> for i16
Available on crate feature sqlite
only.
impl FromSql<SmallInt, Sqlite> for i16
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Integer, Sqlite> for i32
Available on crate feature sqlite
only.
impl FromSql<Integer, Sqlite> for i32
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Bool, Sqlite> for bool
Available on crate feature sqlite
only.
impl FromSql<Bool, Sqlite> for bool
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<BigInt, Sqlite> for i64
Available on crate feature sqlite
only.
impl FromSql<BigInt, Sqlite> for i64
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Float, Sqlite> for f32
Available on crate feature sqlite
only.
impl FromSql<Float, Sqlite> for f32
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl FromSql<Double, Sqlite> for f64
Available on crate feature sqlite
only.
impl FromSql<Double, Sqlite> for f64
sqlite
only.fn from_sql(value: SqliteValue<'_, '_, '_>) -> Result<Self>
sourceimpl<T, ST, DB> FromSql<Nullable<ST>, DB> for Option<T> where
T: FromSql<ST, DB>,
DB: Backend,
ST: SqlType<IsNull = NotNull>,
impl<T, ST, DB> FromSql<Nullable<ST>, DB> for Option<T> where
T: FromSql<ST, DB>,
DB: Backend,
ST: SqlType<IsNull = NotNull>,
sourceimpl<'a, T: ?Sized, ST, DB> FromSql<ST, DB> for Cow<'a, T> where
T: 'a + ToOwned,
DB: Backend,
T::Owned: FromSql<ST, DB>,
impl<'a, T: ?Sized, ST, DB> FromSql<ST, DB> for Cow<'a, T> where
T: 'a + ToOwned,
DB: Backend,
T::Owned: FromSql<ST, DB>,
Implementors
impl FromSql<Date, Mysql> for MysqlTime
mysql_backend
only.impl FromSql<Date, Pg> for PgDate
postgres_backend
only.impl FromSql<Datetime, Mysql> for MysqlTime
mysql_backend
only.impl FromSql<Interval, Pg> for PgInterval
postgres_backend
only.impl FromSql<Money, Pg> for PgMoney
postgres_backend
only.impl FromSql<Numeric, Pg> for PgNumeric
postgres_backend
only.impl FromSql<Time, Mysql> for MysqlTime
mysql_backend
only.impl FromSql<Time, Pg> for PgTime
postgres_backend
only.impl FromSql<Timestamp, Mysql> for MysqlTime
mysql_backend
only.impl FromSql<Timestamp, Pg> for PgTimestamp
postgres_backend
only.impl FromSql<Timestamptz, Pg> for PgTimestamp
postgres_backend
only.