Trait block_tools::db::use_diesel::expression_methods::NullableExpressionMethods[][src]

pub trait NullableExpressionMethods: Expression {
    pub fn nullable(self) -> Nullable<Self> { ... }
}

Methods present on all expressions

Provided methods

pub fn nullable(self) -> Nullable<Self>[src]

Converts this potentially non-null expression into one which is treated as nullable. This method has no impact on the generated SQL, and is only used to allow certain comparisons that would otherwise fail to compile.

Example

table! {
    posts {
        id -> Integer,
        user_id -> Integer,
        author_name -> Nullable<VarChar>,
    }
}

fn main() {
    use self::users::dsl::*;
    use self::posts::dsl::{posts, author_name};
    let connection = establish_connection();

    let data = users.inner_join(posts)
        .filter(name.nullable().eq(author_name))
        .select(name)
        .load::<String>(&connection);
    println!("{:?}", data);
}
Loading content...

Implementors

impl<T> NullableExpressionMethods for T where
    T: Expression
[src]

Loading content...