Trait diesel::types::ToSql
[−]
[src]
pub trait ToSql<A, DB: Backend + HasSqlType<A>>: Debug { fn to_sql<W: Write>(
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>; }
Serializes a single value to be sent to the database. The output will be included as a bind parameter, and is expected to be the binary format, not text.
Required Methods
fn to_sql<W: Write>(
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>
Implementors
impl<'a, DB> ToSql<Nullable<Date>, DB> for NaiveDate where
DB: Backend + HasSqlType<Date>,
NaiveDate: ToSql<Date, DB>,impl<'a, DB> ToSql<Nullable<Time>, DB> for NaiveTime where
DB: Backend + HasSqlType<Time>,
NaiveTime: ToSql<Time, DB>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for NaiveDateTime where
DB: Backend + HasSqlType<Timestamp>,
NaiveDateTime: ToSql<Timestamp, DB>,impl ToSql<Timestamp, Debug> for PgTimestamp
impl ToSql<Timestamptz, Debug> for PgTimestamp
impl ToSql<Date, Debug> for PgDate
impl ToSql<Time, Debug> for PgTime
impl ToSql<Interval, Debug> for PgInterval
impl ToSql<Timestamp, Debug> for Timespec
impl ToSql<Timestamp, Debug> for NaiveDateTime
impl ToSql<Time, Debug> for NaiveTime
impl ToSql<Date, Debug> for NaiveDate
impl<TZ: TimeZone> ToSql<Timestamptz, Debug> for DateTime<TZ>
impl ToSql<Bool, Debug> for bool
impl ToSql<Timestamp, Debug> for SystemTime
impl<DB: Backend> ToSql<Float, DB> for f32
impl<DB: Backend> ToSql<Double, DB> for f64
impl<DB: Backend> ToSql<SmallInt, DB> for i16
impl<DB: Backend> ToSql<Integer, DB> for i32
impl<DB: Backend> ToSql<BigInt, DB> for i64
impl<T, ST, DB> ToSql<Nullable<ST>, DB> for Option<T> where
T: ToSql<ST, DB>,
DB: Backend + HasSqlType<ST>,
ST: NotNull,impl<'a, DB> ToSql<Nullable<Bool>, DB> for bool where
DB: Backend + HasSqlType<Bool>,
bool: ToSql<Bool, DB>,impl<'a, DB> ToSql<Nullable<SmallInt>, DB> for i16 where
DB: Backend + HasSqlType<SmallInt>,
i16: ToSql<SmallInt, DB>,impl<'a, DB> ToSql<Nullable<Integer>, DB> for i32 where
DB: Backend + HasSqlType<Integer>,
i32: ToSql<Integer, DB>,impl<'a, DB> ToSql<Nullable<BigInt>, DB> for i64 where
DB: Backend + HasSqlType<BigInt>,
i64: ToSql<BigInt, DB>,impl<'a, DB> ToSql<Nullable<Float>, DB> for f32 where
DB: Backend + HasSqlType<Float>,
f32: ToSql<Float, DB>,impl<'a, DB> ToSql<Nullable<Double>, DB> for f64 where
DB: Backend + HasSqlType<Double>,
f64: ToSql<Double, DB>,impl<'a, DB> ToSql<Nullable<Text>, DB> for String where
DB: Backend + HasSqlType<Text>,
String: ToSql<Text, DB>,impl<'a, DB> ToSql<Nullable<Binary>, DB> for Vec<u8> where
DB: Backend + HasSqlType<Binary>,
Vec<u8>: ToSql<Binary, DB>,impl<'a, DB> ToSql<Nullable<Text>, DB> for &'a str where
DB: Backend + HasSqlType<Text>,
&'a str: ToSql<Text, DB>,impl<'a, DB> ToSql<Nullable<Binary>, DB> for &'a [u8] where
DB: Backend + HasSqlType<Binary>,
&'a [u8]: ToSql<Binary, DB>,impl<'a, DB: Backend> ToSql<Text, DB> for &'a str
impl<DB> ToSql<Text, DB> for String where
DB: Backend,
&'a str: ToSql<Text, DB>,impl<DB> ToSql<Binary, DB> for Vec<u8> where
DB: Backend,
&'a [u8]: ToSql<Binary, DB>,impl<'a, DB: Backend> ToSql<Binary, DB> for &'a [u8]
impl<'a, T: ?Sized, ST, DB> ToSql<ST, DB> for Cow<'a, T> where
T: 'a + ToOwned + ToSql<ST, DB>,
DB: Backend + HasSqlType<ST>,
T::Owned: ToSql<ST, DB>,impl<'a, DB> ToSql<Nullable<Numeric>, DB> for BigDecimal where
DB: Backend + HasSqlType<Numeric>,
BigDecimal: ToSql<Numeric, DB>,impl<'a, A, T, DB> ToSql<A, DB> for &'a T where
DB: Backend + HasSqlType<A>,
T: ToSql<A, DB>,impl ToSql<Timestamp, Mysql> for MYSQL_TIME
impl ToSql<Time, Mysql> for MYSQL_TIME
impl ToSql<Date, Mysql> for MYSQL_TIME
impl ToSql<Timestamp, Mysql> for NaiveDateTime
impl ToSql<Time, Mysql> for NaiveTime
impl ToSql<Date, Mysql> for NaiveDate
impl<'a, DB> ToSql<Nullable<Tinyint>, DB> for i8 where
DB: Backend + HasSqlType<Tinyint>,
i8: ToSql<Tinyint, DB>,impl ToSql<Tinyint, Mysql> for i8
impl ToSql<Bool, Mysql> for bool
impl<'a, ST, T> ToSql<Array<ST>, Pg> for &'a [T] where
Pg: HasSqlType<ST>,
T: ToSql<ST, Pg>,impl<'a, ST, T> ToSql<Nullable<Array<ST>>, Pg> for &'a [T] where
Pg: HasSqlType<ST>,
&'a [T]: ToSql<Array<ST>, Pg>,impl<ST, T> ToSql<Array<ST>, Pg> for Vec<T> where
Pg: HasSqlType<ST>,
&'a [T]: ToSql<Array<ST>, Pg>,
T: Debug,impl<ST, T> ToSql<Nullable<Array<ST>>, Pg> for Vec<T> where
Pg: HasSqlType<ST>,
Vec<T>: ToSql<Array<ST>, Pg>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for SystemTime where
DB: Backend + HasSqlType<Timestamp>,
SystemTime: ToSql<Timestamp, DB>,impl ToSql<Timestamp, Pg> for SystemTime
impl<'a, DB> ToSql<Nullable<Timestamptz>, DB> for NaiveDateTime where
DB: Backend + HasSqlType<Timestamptz>,
NaiveDateTime: ToSql<Timestamptz, DB>,impl<'a, DB> ToSql<Nullable<Timestamptz>, DB> for DateTime<Utc> where
DB: Backend + HasSqlType<Timestamptz>,
DateTime<Utc>: ToSql<Timestamptz, DB>,impl<'a, DB> ToSql<Nullable<Timestamptz>, DB> for DateTime<FixedOffset> where
DB: Backend + HasSqlType<Timestamptz>,
DateTime<FixedOffset>: ToSql<Timestamptz, DB>,impl<'a, DB> ToSql<Nullable<Timestamptz>, DB> for DateTime<Local> where
DB: Backend + HasSqlType<Timestamptz>,
DateTime<Local>: ToSql<Timestamptz, DB>,impl ToSql<Timestamp, Pg> for NaiveDateTime
impl ToSql<Timestamptz, Pg> for NaiveDateTime
impl<TZ: TimeZone> ToSql<Timestamptz, Pg> for DateTime<TZ>
impl ToSql<Time, Pg> for NaiveTime
impl ToSql<Date, Pg> for NaiveDate
impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for Timespec where
DB: Backend + HasSqlType<Timestamp>,
Timespec: ToSql<Timestamp, DB>,impl ToSql<Timestamp, Pg> for Timespec
impl<'a, DB> ToSql<Nullable<Date>, DB> for PgDate where
DB: Backend + HasSqlType<Date>,
PgDate: ToSql<Date, DB>,impl<'a, DB> ToSql<Nullable<Time>, DB> for PgTime where
DB: Backend + HasSqlType<Time>,
PgTime: ToSql<Time, DB>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamp>,
PgTimestamp: ToSql<Timestamp, DB>,impl<'a, DB> ToSql<Nullable<Timestamptz>, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamptz>,
PgTimestamp: ToSql<Timestamptz, DB>,impl<'a, DB> ToSql<Nullable<Interval>, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: ToSql<Interval, DB>,impl ToSql<Timestamp, Pg> for PgTimestamp
impl ToSql<Timestamptz, Pg> for PgTimestamp
impl ToSql<Date, Pg> for PgDate
impl ToSql<Time, Pg> for PgTime
impl ToSql<Interval, Pg> for PgInterval
impl ToSql<Numeric, Pg> for PgNumeric
impl<'a, DB> ToSql<Nullable<MacAddr>, DB> for [u8; 6] where
DB: Backend + HasSqlType<MacAddr>,
[u8; 6]: ToSql<MacAddr, DB>,impl<'a, DB> ToSql<Nullable<Inet>, DB> for IpNetwork where
DB: Backend + HasSqlType<Inet>,
IpNetwork: ToSql<Inet, DB>,impl<'a, DB> ToSql<Nullable<Cidr>, DB> for IpNetwork where
DB: Backend + HasSqlType<Cidr>,
IpNetwork: ToSql<Cidr, DB>,impl ToSql<MacAddr, Pg> for [u8; 6]
impl ToSql<Inet, Pg> for IpNetwork
impl ToSql<Cidr, Pg> for IpNetwork
impl<'a, DB> ToSql<Nullable<Oid>, DB> for u32 where
DB: Backend + HasSqlType<Oid>,
u32: ToSql<Oid, DB>,impl ToSql<Oid, Pg> for u32
impl ToSql<Numeric, Pg> for BigDecimal
impl<'a, DB> ToSql<Nullable<Numeric>, DB> for PgNumeric where
DB: Backend + HasSqlType<Numeric>,
PgNumeric: ToSql<Numeric, DB>,impl ToSql<Bool, Pg> for bool
impl<'a, DB> ToSql<Nullable<Uuid>, DB> for Uuid where
DB: Backend + HasSqlType<Uuid>,
Uuid: ToSql<Uuid, DB>,impl ToSql<Uuid, Pg> for Uuid
impl<'a, DB> ToSql<Nullable<Json>, DB> for Value where
DB: Backend + HasSqlType<Json>,
Value: ToSql<Json, DB>,impl<'a, DB> ToSql<Nullable<Jsonb>, DB> for Value where
DB: Backend + HasSqlType<Jsonb>,
Value: ToSql<Jsonb, DB>,impl ToSql<Json, Pg> for Value
impl ToSql<Jsonb, Pg> for Value
impl<'a, DB> ToSql<Nullable<Money>, DB> for PgMoney where
DB: Backend + HasSqlType<Money>,
PgMoney: ToSql<Money, DB>,impl ToSql<Money, Pg> for PgMoney
impl ToSql<Date, Sqlite> for NaiveDate
impl ToSql<Time, Sqlite> for NaiveTime
impl ToSql<Timestamp, Sqlite> for NaiveDateTime
impl<'a, DB> ToSql<Nullable<Date>, DB> for String where
DB: Backend + HasSqlType<Date>,
String: ToSql<Date, DB>,impl<'a, DB> ToSql<Nullable<Date>, DB> for &'a str where
DB: Backend + HasSqlType<Date>,
&'a str: ToSql<Date, DB>,impl<'a, DB> ToSql<Nullable<Time>, DB> for String where
DB: Backend + HasSqlType<Time>,
String: ToSql<Time, DB>,impl<'a, DB> ToSql<Nullable<Time>, DB> for &'a str where
DB: Backend + HasSqlType<Time>,
&'a str: ToSql<Time, DB>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for String where
DB: Backend + HasSqlType<Timestamp>,
String: ToSql<Timestamp, DB>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for &'a str where
DB: Backend + HasSqlType<Timestamp>,
&'a str: ToSql<Timestamp, DB>,impl<'a> ToSql<Date, Sqlite> for &'a str
impl ToSql<Date, Sqlite> for String
impl<'a> ToSql<Time, Sqlite> for &'a str
impl ToSql<Time, Sqlite> for String
impl<'a> ToSql<Timestamp, Sqlite> for &'a str
impl ToSql<Timestamp, Sqlite> for String
impl ToSql<Bool, Sqlite> for bool