diesel::serialize

Trait ToSql

Source
pub trait ToSql<A, DB: Backend>: Debug {
    // Required method
    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result;
}
Expand description

Serializes a single value to be sent to the database.

The output is sent as a bind parameter, and the data must be written in the expected format for the given backend.

When possible, implementations of this trait should prefer using an existing implementation, rather than writing to out directly. (For example, if you are implementing this for an enum, which is represented as an integer in the database, you should use i32::to_sql(x, out) instead of writing to out yourself.)

Any types which implement this trait should also #[derive(AsExpression)].

§Backend specific details

  • For PostgreSQL, the bytes will be sent using the binary protocol, not text.
  • For SQLite, all implementations should be written in terms of an existing ToSql implementation.
  • For MySQL, the expected bytes will depend on the return value of type_metadata for the given SQL type. See MysqlType 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, AsExpression)]
#[diesel(sql_type = Integer)]
pub enum MyEnum {
    A = 1,
    B = 2,
}

impl<DB> ToSql<Integer, DB> for MyEnum
where
    DB: Backend,
    i32: ToSql<Integer, DB>,
{
    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> serialize::Result {
        match self {
            MyEnum::A => 1.to_sql(out),
            MyEnum::B => 2.to_sql(out),
        }
    }
}

Example of creating a custom type mapping based on a MySQL enum type

This is designed to reuse the SQL type definition generated by diesel-cli

pub mod sql_types {
   #[derive(diesel::sql_types::SqlType)]
   #[diesel(mysql_type(name = "Enum"))]
   pub struct PostEnum; //<- generated by diesel cli
}
#[derive(Debug, AsExpression, PartialEq, Clone)]
#[diesel(sql_type = sql_types::PostEnum)]
pub enum Post {
   FirstValue,
   SecondValue,
}

impl ToSql<sql_types::PostEnum, diesel::mysql::Mysql> for Post {
   fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, diesel::mysql::Mysql>) -> serialize::Result {
       match *self {
           // these string values need to match the labels used in your
           // enum definition in SQL. So this expects that you defined the
           /// relevant enum type as`ENUM('one', 'two')` in your `CREATE TABLE` statement
           Post::FirstValue => out.write_all(b"one")?,
           Post::SecondValue => out.write_all(b"two")?,
       }
       Ok(IsNull::No)
   }
}

Using temporary values as part of the ToSql implementation requires additional work.

Backends using RawBytesBindCollector as BindCollector copy the serialized values as part of Write implementation. This includes the Mysql and the Pg backend provided by diesel. This means existing ToSql implementations can be used even with temporary values. For these it is required to call Output::reborrow to shorten the lifetime of the Output type correspondingly.

#[repr(i32)]
#[derive(Debug, Clone, Copy, AsExpression)]
#[diesel(sql_type = Integer)]
pub enum MyEnum {
    A = 1,
    B = 2,
}

impl ToSql<Integer, diesel::pg::Pg> for MyEnum
where
    i32: ToSql<Integer, diesel::pg::Pg>,
{
    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, diesel::pg::Pg>) -> serialize::Result {
        let v = *self as i32;
        <i32 as ToSql<Integer, diesel::pg::Pg>>::to_sql(&v, &mut out.reborrow())
    }
}

For any other backend the Output::set_value method provides a way to set the output value directly. Checkout the documentation of the corresponding BindCollector::Buffer type for provided From<T> implementations for a list of accepted types. For the Sqlite backend see SqliteBindValue.

#[repr(i32)]
#[derive(Debug, Clone, Copy, AsExpression)]
#[diesel(sql_type = Integer)]
pub enum MyEnum {
    A = 1,
    B = 2,
}

impl ToSql<Integer, diesel::sqlite::Sqlite> for MyEnum
where
    i32: ToSql<Integer, diesel::sqlite::Sqlite>,
{
    fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, diesel::sqlite::Sqlite>) -> serialize::Result {
        out.set_value(*self as i32);
        Ok(IsNull::No)
    }
}

Required Methods§

Source

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

See the trait documentation.

Implementations on Foreign Types§

Source§

impl ToSql<BigInt, Mysql> for i64

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<BigInt, Pg> for i64

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<BigInt, Sqlite> for i64

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Binary, Sqlite> for [u8]

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Bool, Mysql> for bool

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Bool, Pg> for bool

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Bool, Sqlite> for bool

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<CChar, Pg> for u8

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Cidr, Pg> for IpNet

Available on crate features ipnet-address and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Cidr, Pg> for IpNetwork

Available on crate features network-address and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Citext, Pg> for str

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Citext, Pg> for String

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Date, Mysql> for NaiveDate

Available on crate features chrono and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Date, Mysql> for Date

Available on crate features time and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Date, Pg> for NaiveDate

Available on crate features chrono and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Date, Pg> for Date

Available on crate features time and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Date, Sqlite> for str

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Date, Sqlite> for NaiveDate

Available on crate features chrono and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Date, Sqlite> for Date

Available on crate features time and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Date, Sqlite> for String

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Datetime, Mysql> for NaiveDateTime

Available on crate features chrono and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Datetime, Mysql> for OffsetDateTime

Available on crate features time and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Datetime, Mysql> for PrimitiveDateTime

Available on crate features time and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Double, Mysql> for f64

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Double, Pg> for f64

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Double, Sqlite> for f64

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Float, Mysql> for f32

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Float, Pg> for f32

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Float, Sqlite> for f32

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Inet, Pg> for IpNet

Available on crate features ipnet-address and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Inet, Pg> for IpNetwork

Available on crate features network-address and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Integer, Mysql> for i32

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Integer, Pg> for i32

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Integer, Sqlite> for i32

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Interval, Pg> for Duration

Available on crate features chrono and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Json, Mysql> for Value

Available on crate features serde_json and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Json, Pg> for Value

Available on crate features serde_json and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Json, Sqlite> for Value

Available on crate features sqlite and serde_json only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Jsonb, Pg> for Value

Available on crate features serde_json and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Jsonb, Sqlite> for Value

Available on crate features sqlite and serde_json only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<MacAddr8, Pg> for [u8; 8]

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<MacAddr, Pg> for [u8; 6]

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Numeric, Mysql> for BigDecimal

Available on crate features numeric and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Numeric, Pg> for BigDecimal

Available on crate features numeric and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Oid, Pg> for u32

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<SmallInt, Mysql> for i16

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<SmallInt, Pg> for i16

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<SmallInt, Sqlite> for i16

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Text, Sqlite> for str

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Time, Mysql> for NaiveTime

Available on crate features chrono and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Time, Mysql> for Time

Available on crate features time and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Time, Pg> for NaiveTime

Available on crate features chrono and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Time, Pg> for Time

Available on crate features time and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Time, Sqlite> for str

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Time, Sqlite> for NaiveTime

Available on crate features chrono and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Time, Sqlite> for Time

Available on crate features time and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Time, Sqlite> for String

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamp, Mysql> for NaiveDateTime

Available on crate features chrono and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Timestamp, Mysql> for OffsetDateTime

Available on crate features time and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Timestamp, Mysql> for PrimitiveDateTime

Available on crate features time and mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Timestamp, Pg> for NaiveDateTime

Available on crate features chrono and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Timestamp, Pg> for PrimitiveDateTime

Available on crate features time and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Timestamp, Pg> for SystemTime

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Timestamp, Sqlite> for str

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamp, Sqlite> for NaiveDateTime

Available on crate features chrono and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamp, Sqlite> for PrimitiveDateTime

Available on crate features time and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamp, Sqlite> for String

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamptz, Pg> for NaiveDateTime

Available on crate features chrono and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Timestamptz, Pg> for OffsetDateTime

Available on crate features time and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Timestamptz, Pg> for PrimitiveDateTime

Available on crate features time and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl ToSql<Timestamptz, Sqlite> for str

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamptz, Sqlite> for NaiveDateTime

Available on crate features chrono and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamptz, Sqlite> for OffsetDateTime

Available on crate features time and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamptz, Sqlite> for PrimitiveDateTime

Available on crate features time and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<Timestamptz, Sqlite> for String

Available on crate feature sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl ToSql<TinyInt, Mysql> for i8

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Unsigned<BigInt>, Mysql> for u64

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Unsigned<Integer>, Mysql> for u32

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Unsigned<SmallInt>, Mysql> for u16

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Unsigned<TinyInt>, Mysql> for u8

Available on crate feature mysql_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Mysql>) -> Result

Source§

impl ToSql<Uuid, Pg> for Uuid

Available on crate features uuid and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<'a, T, ST, DB> ToSql<ST, DB> for Cow<'a, T>
where T: 'a + ToOwned + ToSql<ST, DB> + ?Sized, DB: Backend, Self: Debug,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<A, T, DB> ToSql<A, DB> for &T
where DB: Backend, T: ToSql<A, DB> + ?Sized,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<DB> ToSql<Binary, DB> for Vec<u8>
where DB: Backend, [u8]: ToSql<Binary, DB>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<DB> ToSql<Binary, DB> for [u8]
where for<'a> DB: Backend<BindCollector<'a> = RawBytesBindCollector<DB>>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<DB> ToSql<Text, DB> for str
where for<'a> DB: Backend<BindCollector<'a> = RawBytesBindCollector<DB>>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<DB> ToSql<Text, DB> for String
where DB: Backend, str: ToSql<Text, DB>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<DB, const N: usize> ToSql<Binary, DB> for [u8; N]
where DB: Backend, [u8]: ToSql<Binary, DB>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<ST, T> ToSql<Array<ST>, Pg> for [T]
where Pg: HasSqlType<ST>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Array<ST>, Pg> for Vec<T>
where ST: 'static, [T]: ToSql<Array<ST>, Pg>, T: Debug,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Multirange<ST>, Pg> for [Range<T>]
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Multirange<ST>, Pg> for [RangeFrom<T>]
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Multirange<ST>, Pg> for [RangeInclusive<T>]
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Multirange<ST>, Pg> for [RangeTo<T>]
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Multirange<ST>, Pg> for [RangeToInclusive<T>]
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Array<ST>>, Pg> for [T]
where [T]: ToSql<Array<ST>, Pg>, ST: 'static,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Array<ST>>, Pg> for Vec<T>
where ST: 'static, Vec<T>: ToSql<Array<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Range<ST>>, Pg> for (Bound<T>, Bound<T>)
where ST: 'static, (Bound<T>, Bound<T>): ToSql<Range<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Range<ST>>, Pg> for Range<T>
where ST: 'static, Range<T>: ToSql<Range<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Range<ST>>, Pg> for RangeFrom<T>
where ST: 'static, RangeFrom<T>: ToSql<Range<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Range<ST>>, Pg> for RangeInclusive<T>
where ST: 'static, RangeInclusive<T>: ToSql<Range<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Range<ST>>, Pg> for RangeTo<T>
where ST: 'static, RangeTo<T>: ToSql<Range<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Nullable<Range<ST>>, Pg> for RangeToInclusive<T>
where ST: 'static, RangeToInclusive<T>: ToSql<Range<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Range<ST>, Pg> for (Bound<T>, Bound<T>)
where T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Range<ST>, Pg> for Range<T>
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Range<ST>, Pg> for RangeFrom<T>
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Range<ST>, Pg> for RangeInclusive<T>
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Range<ST>, Pg> for RangeTo<T>
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<ST, T> ToSql<Range<ST>, Pg> for RangeToInclusive<T>
where ST: 'static, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for Vec<(Bound<T>, Bound<T>)>
where T: ToSql<ST, Pg>, [(Bound<T>, Bound<T>)]: ToSql<Multirange<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for Vec<Range<T>>
where T: ToSql<ST, Pg>, [Range<T>]: ToSql<Multirange<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for Vec<RangeFrom<T>>
where T: ToSql<ST, Pg>, [RangeFrom<T>]: ToSql<Multirange<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for Vec<RangeInclusive<T>>
where T: ToSql<ST, Pg>, [RangeInclusive<T>]: ToSql<Multirange<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for Vec<RangeTo<T>>
where T: ToSql<ST, Pg>, [RangeTo<T>]: ToSql<Multirange<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for Vec<RangeToInclusive<T>>
where T: ToSql<ST, Pg>, [RangeToInclusive<T>]: ToSql<Multirange<ST>, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Multirange<ST>, Pg> for [(Bound<T>, Bound<T>)]
where T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for Vec<(Bound<T>, Bound<T>)>
where ST: 'static, Vec<(Bound<T>, Bound<T>)>: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for Vec<Range<T>>
where ST: 'static, Vec<Range<T>>: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for Vec<RangeFrom<T>>
where ST: 'static, Vec<RangeFrom<T>>: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for Vec<RangeInclusive<T>>
where ST: 'static, Vec<RangeInclusive<T>>: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for Vec<RangeTo<T>>
where ST: 'static, Vec<RangeTo<T>>: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for Vec<RangeToInclusive<T>>
where ST: 'static, Vec<RangeToInclusive<T>>: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for [(Bound<T>, Bound<T>)]
where ST: 'static, [(Bound<T>, Bound<T>)]: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for [Range<T>]
where ST: 'static, [Range<T>]: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for [RangeFrom<T>]
where ST: 'static, [RangeFrom<T>]: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for [RangeInclusive<T>]
where ST: 'static, [RangeInclusive<T>]: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for [RangeTo<T>]
where ST: 'static, [RangeTo<T>]: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST> ToSql<Nullable<Multirange<ST>>, Pg> for [RangeToInclusive<T>]
where ST: 'static, [RangeToInclusive<T>]: ToSql<ST, Pg>, T: ToSql<ST, Pg>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<T, ST, DB> ToSql<Nullable<ST>, DB> for Option<T>
where T: ToSql<ST, DB>, DB: Backend, ST: SqlType<IsNull = NotNull>,

Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> Result

Source§

impl<TZ: TimeZone> ToSql<Timestamptz, Pg> for DateTime<TZ>

Available on crate features chrono and postgres_backend only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> Result

Source§

impl<TZ: TimeZone> ToSql<Timestamptz, Sqlite> for DateTime<TZ>

Available on crate features chrono and sqlite only.
Source§

fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Sqlite>) -> Result

Source§

impl<Tz: TimeZone, __DB> ToSql<Nullable<Timestamptz>, __DB> for DateTime<Tz>
where __DB: Backend, Self: ToSql<Timestamptz, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<Tz: TimeZone, __DB> ToSql<Nullable<Timestamptz>, __DB> for DateTime<Tz>
where __DB: Backend, Self: ToSql<TimestamptzSqlite, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<BigInt>, __DB> for i64
where __DB: Backend, Self: ToSql<BigInt, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Binary>, __DB> for Vec<u8>
where __DB: Backend, Self: ToSql<Binary, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Binary>, __DB> for [u8]
where __DB: Backend, Self: ToSql<Binary, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Bool>, __DB> for bool
where __DB: Backend, Self: ToSql<Bool, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<CChar>, __DB> for u8
where __DB: Backend, Self: ToSql<CChar, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Cidr>, __DB> for IpNet
where __DB: Backend, Self: ToSql<Cidr, __DB>,

Available on crate features ipnet-address and postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Cidr>, __DB> for IpNetwork
where __DB: Backend, Self: ToSql<Cidr, __DB>,

Available on crate features network-address and postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Citext>, __DB> for str
where __DB: Backend, Self: ToSql<Citext, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Citext>, __DB> for String
where __DB: Backend, Self: ToSql<Citext, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Date>, __DB> for str
where __DB: Backend, Self: ToSql<Date, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Date>, __DB> for NaiveDate
where __DB: Backend, Self: ToSql<Date, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Date>, __DB> for NaiveDate
where __DB: Backend, Self: ToSql<Date, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Date>, __DB> for String
where __DB: Backend, Self: ToSql<Date, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Datetime>, __DB> for NaiveDateTime
where __DB: Backend, Self: ToSql<Datetime, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Datetime>, __DB> for OffsetDateTime
where __DB: Backend, Self: ToSql<Datetime, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Datetime>, __DB> for PrimitiveDateTime
where __DB: Backend, Self: ToSql<Datetime, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Double>, __DB> for f64
where __DB: Backend, Self: ToSql<Double, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Float>, __DB> for f32
where __DB: Backend, Self: ToSql<Float, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Inet>, __DB> for IpNet
where __DB: Backend, Self: ToSql<Inet, __DB>,

Available on crate features ipnet-address and postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Inet>, __DB> for IpNetwork
where __DB: Backend, Self: ToSql<Inet, __DB>,

Available on crate features network-address and postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Integer>, __DB> for i32
where __DB: Backend, Self: ToSql<Integer, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Interval>, __DB> for Duration
where __DB: Backend, Self: ToSql<Interval, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Json>, __DB> for Value
where __DB: Backend, Self: ToSql<Json, __DB>,

Available on crate feature serde_json and (crate features postgres_backend or mysql_backend or sqlite) only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Jsonb>, __DB> for Value
where __DB: Backend, Self: ToSql<Jsonb, __DB>,

Available on crate feature serde_json and (crate features postgres_backend or mysql_backend or sqlite) only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<MacAddr8>, __DB> for [u8; 8]
where __DB: Backend, Self: ToSql<MacAddr8, __DB>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<MacAddr>, __DB> for [u8; 6]
where __DB: Backend, Self: ToSql<MacAddr, __DB>,

Available on crate feature postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Numeric>, __DB> for BigDecimal
where __DB: Backend, Self: ToSql<Numeric, __DB>,

Available on crate feature numeric only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Oid>, __DB> for u32
where __DB: Backend, Self: ToSql<Oid, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<SmallInt>, __DB> for i16
where __DB: Backend, Self: ToSql<SmallInt, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Text>, __DB> for str
where __DB: Backend, Self: ToSql<Text, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Text>, __DB> for String
where __DB: Backend, Self: ToSql<Text, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Time>, __DB> for str
where __DB: Backend, Self: ToSql<Time, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Time>, __DB> for NaiveTime
where __DB: Backend, Self: ToSql<Time, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Time>, __DB> for NaiveTime
where __DB: Backend, Self: ToSql<Time, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Time>, __DB> for String
where __DB: Backend, Self: ToSql<Time, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for str
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for NaiveDateTime
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for PrimitiveDateTime
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for String
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for SystemTime
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamptz>, __DB> for NaiveDateTime
where __DB: Backend, Self: ToSql<Timestamptz, __DB>,

Available on crate feature chrono only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamptz>, __DB> for OffsetDateTime
where __DB: Backend, Self: ToSql<Timestamptz, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamptz>, __DB> for PrimitiveDateTime
where __DB: Backend, Self: ToSql<Timestamptz, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Timestamptz>, __DB> for OffsetDateTime
where __DB: Backend, Self: ToSql<TimestamptzSqlite, __DB>,

Available on crate feature time only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<TinyInt>, __DB> for i8
where __DB: Backend, Self: ToSql<TinyInt, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Unsigned<BigInt>>, __DB> for u64
where __DB: Backend, Self: ToSql<Unsigned<BigInt>, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Unsigned<Integer>>, __DB> for u32
where __DB: Backend, Self: ToSql<Unsigned<Integer>, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Unsigned<SmallInt>>, __DB> for u16
where __DB: Backend, Self: ToSql<Unsigned<SmallInt>, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Unsigned<TinyInt>>, __DB> for u8
where __DB: Backend, Self: ToSql<Unsigned<TinyInt>, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<__DB> ToSql<Nullable<Uuid>, __DB> for Uuid
where __DB: Backend, Self: ToSql<Uuid, __DB>,

Available on crate features uuid and postgres_backend only.
Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Source§

impl<const N: usize, __DB> ToSql<Nullable<Binary>, __DB> for [u8; N]
where __DB: Backend, Self: ToSql<Binary, __DB>,

Source§

fn to_sql<'__b>(&'__b self, out: &mut Output<'__b, '_, __DB>) -> Result

Implementors§

Source§

impl ToSql<Date, Mysql> for MysqlTime

Available on crate feature mysql_backend only.
Source§

impl ToSql<Date, Pg> for PgDate

Available on crate feature postgres_backend only.
Source§

impl ToSql<Datetime, Mysql> for MysqlTime

Available on crate feature mysql_backend only.
Source§

impl ToSql<Interval, Pg> for PgInterval

Available on crate feature postgres_backend only.
Source§

impl ToSql<Money, Pg> for PgMoney

Available on crate feature postgres_backend only.
Source§

impl ToSql<NullValueTreatmentEnum, Pg> for NullValueTreatment

Available on crate feature postgres_backend only.
Source§

impl ToSql<Numeric, Pg> for PgNumeric

Available on crate feature postgres_backend only.
Source§

impl ToSql<RangeBoundEnum, Pg> for RangeBound

Available on crate feature postgres_backend only.
Source§

impl ToSql<Time, Mysql> for MysqlTime

Available on crate feature mysql_backend only.
Source§

impl ToSql<Time, Pg> for PgTime

Available on crate feature postgres_backend only.
Source§

impl ToSql<Timestamp, Mysql> for MysqlTime

Available on crate feature mysql_backend only.
Source§

impl ToSql<Timestamp, Pg> for PgTimestamp

Available on crate feature postgres_backend only.
Source§

impl ToSql<Timestamptz, Pg> for PgTimestamp

Available on crate feature postgres_backend only.
Source§

impl<'a, DB> ToSql<Text, DB> for MigrationVersion<'a>
where Cow<'a, str>: ToSql<Text, DB>, DB: Backend,

Source§

impl<'a, __DB> ToSql<Nullable<Text>, __DB> for MigrationVersion<'a>
where __DB: Backend, Self: ToSql<Text, __DB>,

Source§

impl<__DB> ToSql<Nullable<Date>, __DB> for MysqlTime
where __DB: Backend, Self: ToSql<Date, __DB>,

Available on crate feature mysql_backend only.
Source§

impl<__DB> ToSql<Nullable<Date>, __DB> for PgDate
where __DB: Backend, Self: ToSql<Date, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<Datetime>, __DB> for MysqlTime
where __DB: Backend, Self: ToSql<Datetime, __DB>,

Available on crate feature mysql_backend only.
Source§

impl<__DB> ToSql<Nullable<Interval>, __DB> for PgInterval
where __DB: Backend, Self: ToSql<Interval, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<Money>, __DB> for PgMoney
where __DB: Backend, Self: ToSql<Money, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<NullValueTreatmentEnum>, __DB> for NullValueTreatment
where __DB: Backend, Self: ToSql<NullValueTreatmentEnum, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<Numeric>, __DB> for PgNumeric
where __DB: Backend, Self: ToSql<Numeric, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<RangeBoundEnum>, __DB> for RangeBound
where __DB: Backend, Self: ToSql<RangeBoundEnum, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<Time>, __DB> for MysqlTime
where __DB: Backend, Self: ToSql<Time, __DB>,

Available on crate feature mysql_backend only.
Source§

impl<__DB> ToSql<Nullable<Time>, __DB> for PgTime
where __DB: Backend, Self: ToSql<Time, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for MysqlTime
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Available on crate feature mysql_backend only.
Source§

impl<__DB> ToSql<Nullable<Timestamp>, __DB> for PgTimestamp
where __DB: Backend, Self: ToSql<Timestamp, __DB>,

Available on crate feature postgres_backend only.
Source§

impl<__DB> ToSql<Nullable<Timestamptz>, __DB> for PgTimestamp
where __DB: Backend, Self: ToSql<Timestamptz, __DB>,

Available on crate feature postgres_backend only.