Struct diesel::pg::types::sql_types::Money [] [src]

pub struct Money;

The PostgreSQL Money type.

ToSql impls

FromSql impls

Examples

use diesel::data_types::Cents;

table! {
    items {
        id -> Integer,
        name -> VarChar,
        price -> Money,
    }
}

let inserted_price = insert_into(items)
    .values((name.eq("Shiny Thing"), price.eq(Cents(123_456))))
    .returning(price)
    .get_result(&connection);
assert_eq!(Ok(Cents(123_456)), inserted_price);

Trait Implementations

impl<'expr> AsExpression<Money> for &'expr PgMoney
[src]

The expression being returned

[src]

Perform the conversion

impl<'expr2, 'expr> AsExpression<Money> for &'expr2 &'expr PgMoney
[src]

The expression being returned

[src]

Perform the conversion

impl AsExpression<Money> for PgMoney
[src]

The expression being returned

[src]

Perform the conversion

impl FromSql<Money, Pg> for PgMoney
[src]

[src]

See the trait documentation.

impl ToSql<Money, Pg> for PgMoney
[src]

[src]

See the trait documentation.

impl QueryId for Money
[src]

A type which uniquely represents Self in a SQL query. Read more

HAS_STATIC_QUERY_ID: bool = true

Can the SQL generated by Self be uniquely identified by its type? Read more

[src]

Returns the type id of Self::QueryId if Self::HAS_STATIC_QUERY_ID. Returns None otherwise. Read more

impl NotNull for Money
[src]

impl SingleValue for Money
[src]

impl HasSqlType<Money> for Pg
[src]

[src]

Fetch the metadata for the given type Read more

[src]

Fetch the metadata for a tuple representing an entire row Read more

impl Debug for Money
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Money
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Money
[src]

impl Default for Money
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Money

impl Sync for Money