[][src]Trait oracle::sql_type::ToSql

pub trait ToSql {
    fn oratype(&self, conn: &Connection) -> 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 TypeOracle TypeOracle Value
str, Stringnvarchar2(length of the rust value)The specified value
i8, i16, i32, i64, isize, u8, u16, u32, u64, usize, f32, f64numberThe specified value
Vec<u8>raw(length of the rust value)The specified value
boolboolean (PL/SQL only)The specified value
Timestamptimestamp(9) with time zoneThe specified value
IntervalDSinterval day(9) to second(9)The specified value
IntervalYMinterval year(9) to monthThe specified value
Collectiontype returned by Collection.oracle_typeThe specified value
Objecttype returned by Object.oracle_typeThe specified value
Option<T> where T: ToSql + ToSqlNullWhen 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.
OracleTypetype 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 TypeOracle Type
chrono::Datetimestamp(0) with time zone
chrono::DateTimetimestamp(9) with time zone
chrono::naive::NaiveDatetimestamp(0)
chrono::naive::NaiveDateTimetimestamp(9)
chrono::Durationinterval day(9) to second(9)

Required methods

fn oratype(&self, conn: &Connection) -> Result<OracleType>

fn to_sql(&self, val: &mut SqlValue) -> Result<()>

Loading content...

Implementations on Foreign Types

impl ToSql for i8[src]

impl ToSql for i16[src]

impl ToSql for i32[src]

impl ToSql for i64[src]

impl ToSql for isize[src]

impl ToSql for u8[src]

impl ToSql for u16[src]

impl ToSql for u32[src]

impl ToSql for u64[src]

impl ToSql for usize[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<'a> ToSql for &'a [u8][src]

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

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

Loading content...

Implementors

impl ToSql for OracleType[src]

impl ToSql for Collection[src]

impl ToSql for IntervalDS[src]

impl ToSql for IntervalYM[src]

impl ToSql for Object[src]

impl ToSql for Timestamp[src]

Loading content...