Trait diesel::types::ToSql
[−]
[src]
pub trait ToSql<A, DB: Backend + HasSqlType<A>> { fn to_sql<W: Write>(&self,
out: &mut W)
-> 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
Implementors
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: NotNullimpl<'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, A, T, DB> ToSql<A, DB> for &'a T where DB: Backend + HasSqlType<A>,
T: ToSql<A, DB>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