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]
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<T: ToSql + ToSqlNull> ToSql for Option<T>
[src]
impl<'a, T: ToSql> ToSql for (&'a T, &'a OracleType)
[src]
Implementors
impl ToSql for Collection
impl ToSql for Object
impl ToSql for Timestamp
impl ToSql for IntervalDS
impl ToSql for IntervalYM
impl ToSql for OracleType