Struct oracle::SqlValue[][src]

pub struct SqlValue { /* fields omitted */ }

A type containing an Oracle value

When this is a column value in a select statement, the Oracle type is determined by the column type.

When this is a bind value in a SQL statement, the Oracle type is determined by ToSql.oratype.

Methods

impl SqlValue
[src]

Gets the Oracle value. It internally does the followings:

  1. Checks whether the conversion from the Oracle type to the target rust type is allowed. It returns Err(Error::InvalidTypeConversion(...)) when it isn't allowed.
  2. Checks whether the Oracle value is null. When it is null and the return type is Option<FromSql>, it returns Ok(None). When it is null and it isn't Option<FromSql>, it returns Err(Error::NullValue).
  3. Converts the Oracle value to the rust value. The data type is converted implicitly if required. For example string is converted to i64 by [parse][] if get::<i64>() is called for VARCHAR2 columns. If the conversion fails, various errors are returned.

Sets a rust value to the Oracle value. It internally does the followings:

  1. Checks whether the conversion from the rust type to the target Oracle type is allowed. It returns Err(Error::InvalidTypeConversion(...)) when it isn't allowed.
  2. When the argument type is None::<ToSql>, null is set.
  3. Otherwise, converts the rust value to the Oracle value. The data type is converted implicitly if required. For example i64 is converted to string by to_string() if set(100i64) is called for VARCHAR2 columns. When the argument is None::<ToSql> If the conversion fails, various errors are returned.

Returns Ok(true) when the SQL value is null. Ok(false) when it isn't null.

Sets null to the SQL value.

Gets the Oracle type of the SQL value.

Returns a duplicated value of self.

Trait Implementations

impl Display for SqlValue
[src]

Formats any SQL value to string using the given formatter. Note that both a null value and a string NULL are formatted as NULL.

impl Debug for SqlValue
[src]

Formats the value using the given formatter. Read more

impl Drop for SqlValue
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl !Send for SqlValue

impl !Sync for SqlValue