Trait diesel::types::ToSql
[−]
[src]
pub trait ToSql<A, DB: Backend + HasSqlType<A>>: Debug { 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<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, A, T, DB> ToSql<A, DB> for &'a T where
DB: Backend + HasSqlType<A>,
T: ToSql<A, DB>,