Trait oracle::ToSql [] [src]

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

Conversion from rust values to Oracle values.

The type of the Oracle value is determined by the rust type.

Rust Type Oracle Type Oracle Value
str, String nvarchar2(length of the rust value) The specified value
i8, i16, i32, i64, isize, u8, u16, u32, u64, usize, f32, f64 number The specified value
Vec<u8> raw(length of the rust value) The specified value
bool boolean (PL/SQL only) The specified value
Timestamp timestamp(9) with time zone The specified value
IntervalDS interval day(9) to second(9) The specified value
IntervalYM interval year(9) to month The specified value
Collection type returned by Collection.oracle_type The specified value
Object type returned by Object.oracle_type The specified value
Option<T> where T: ToSql + ToSqlNull When the value is Some, the contained value decides the Oracle type. When it is None, ToSqlNull decides it. When the value is Some, the contained value. When it is None, a null value.
OracleType type represented by the OracleType. a null value
(&ToSql, &[OracleType[]) type represented by the second element. The value of the first element

When you need to bind output parameters such as varchar2, use OracleType or (&ToSql, &OracleType) to specify the maximum length of data types.

When chrono feature is enabled, the following conversions are added.

Rust Type Oracle Type
chrono::Date timestamp(0) with time zone
chrono::DateTime timestamp(9) with time zone
chrono::naive::NaiveDate timestamp(0)
chrono::naive::NaiveDateTime timestamp(9)
chrono::Duration interval day(9) to second(9)

Required Methods

Implementations on Foreign Types

impl ToSql for i8
[src]

[src]

[src]

impl ToSql for i16
[src]

[src]

[src]

impl ToSql for i32
[src]

[src]

[src]

impl ToSql for i64
[src]

[src]

[src]

impl ToSql for isize
[src]

[src]

[src]

impl ToSql for u8
[src]

[src]

[src]

impl ToSql for u16
[src]

[src]

[src]

impl ToSql for u32
[src]

[src]

[src]

impl ToSql for u64
[src]

[src]

[src]

impl ToSql for usize
[src]

[src]

[src]

impl ToSql for f64
[src]

[src]

[src]

impl ToSql for f32
[src]

[src]

[src]

impl ToSql for bool
[src]

[src]

[src]

impl ToSql for String
[src]

[src]

[src]

impl ToSql for Vec<u8>
[src]

[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

[src]

Implementors