Trait oracle::ToSql [] [src]

pub trait ToSql {
    fn oratype_default() -> OracleType;
fn to_sql(&self, val: &mut SqlValue) -> Result<()>; fn oratype(&self) -> Result<OracleType> { ... } }

A trait to convert rust values to Oracle values.

The type of converted Oracle value is determined by the rust type. Some types are customizable by bind_value function.

Rust Type Oracle Type
str, String NVARCHAR2(length of the rust value)
str, String via bind_value(value, length) NVARCHAR2(length passed to bind_value())
str, String via bind_value(value, AS_LONG) LONG
str, String via bind_value(value, AS_CLOB) CLOB
str, String via bind_value(value, AS_NCLOB) NCLOB
i8, i16, i32, i64, u8, u16, u32, u64, f32, f64 NUMBER
i8, i16, i32, i64, u8, u16, u32, u64, f32, f64 via bind_value(&value, AS_BINARY_DOUBLE) BINARY_DOUBLE
Vec<u8> RAW(length of the rust value)
Vec<u8> via bind_value(value, length) RAW(length passed to bind_value())
Vec<u8> via bind_value(value, AS_LONG_RAW) LONG RAW
Vec<u8> via bind_value(value, AS_BLOB) BLOB
chrono::DateTime, Timestamp TIMESTAMP(9) WITH TIME ZONE
chrono::Date TIMESTAMP(0) WITH TIME ZONE
chrono::naive::NaiveDateTime TIMESTAMP(9)
chrono::naive::NaiveDate TIMESTAMP(0)
chrono::Duration, IntervalDS INTERVAL DAY(9) TO SECOND(9)
IntervalYM INTERVAL YEAR(9) TO MONTH

Required Methods

Provided Methods

Implementations on Foreign Types

impl<Tz> ToSql for DateTime<Tz> where
    Tz: TimeZone
[src]

impl<Tz> ToSql for Date<Tz> where
    Tz: TimeZone
[src]

impl ToSql for NaiveDateTime
[src]

impl ToSql for NaiveDate
[src]

impl ToSql for Duration
[src]

impl ToSql for i8
[src]

impl ToSql for i16
[src]

impl ToSql for i32
[src]

impl ToSql for i64
[src]

impl ToSql for u8
[src]

impl ToSql for u16
[src]

impl ToSql for u32
[src]

impl ToSql for u64
[src]

impl ToSql for f64
[src]

impl ToSql for f32
[src]

impl ToSql for bool
[src]

impl ToSql for String
[src]

impl ToSql for Vec<u8>
[src]

impl<'a> ToSql for &'a str
[src]

impl<T: ToSql> ToSql for Option<T>
[src]

impl<'a, T: ToSql> ToSql for &'a T
[src]

Implementors