Struct query_builder::WhereClause [] [src]

pub struct WhereClause<'a, 'b> { /* fields omitted */ }

Struct representing an WHERE-Clause

Methods

impl<'a, 'b> WhereClause<'a, 'b>
[src]

[src]

Creates a new WHERE-clause

If the Value of how is none when initializing the clause, Condition::And is assumed and used for the clause.

Note: If the WhereClause is the first one to be inserted in the string of an query, the condition will be left out.

[src]

Returns a String representing the WhereClause with it's condition part The returned String is also the default representation returned when calling the Display trait functions on this struct.

Example

use query_builder::{WhereClause, Condition, Value};
 
let wclause = WhereClause::new("user", Value::Varchar("gerald"), Some(Condition::Or));
 
assert_eq!(wclause.as_string(), "OR user = 'gerald'")

[src]

Returns a String representing the WhereClause without it's condition part but with the WHERE phrase in the beginning

Example

use query_builder::{WhereClause, Value};
 
let clause = WhereClause::new("user", Value::Varchar("thomas"), None);
 
assert_eq!(clause.as_string_no_cond_with_prefix(), "WHERE user = 'thomas'")

[src]

Returns a String representing the WhereClause without WHERE prefix and without it's conditional parts

Example

use query_builder::{WhereClause, Value};
 
let clause = WhereClause::new("user", Value::Varchar("jeanny"), None);
 
assert_eq!(clause.as_string_no_cond(), "user = 'jeanny'")

Trait Implementations

impl<'a, 'b> Debug for WhereClause<'a, 'b>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, 'b> Display for WhereClause<'a, 'b>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a, 'b> Send for WhereClause<'a, 'b>

impl<'a, 'b> Sync for WhereClause<'a, 'b>