Enum query_builder::Value [] [src]

pub enum Value<'c> {
    Varchar(&'c str),
    Bool(bool),
    Tinyint(i8),
    UnsignedTinyint(u8),
    Smallint(i16),
    UnsignedSmallint(u16),
    Int(i32),
    UnsignedInt(u32),
    Bigint(i64),
    UnsignedBigint(u64),
}

Enum representing common SQL-datatypes

Variants

Methods

impl<'c> Value<'c>
[src]

[src]

Convert the Value to a String

Example

use query_builder::Value;
 
// Put single quotes around the varchar to not conflict with e.g. MySQL when inserting data
let v = Value::Varchar("steven");
assert_eq!(v.as_string(), "'steven'");

// Bools are written in caps to make them stand out in queries
let v = Value::Bool(true);
assert_eq!(v.as_string(), "TRUE");

// applies to all numeric Values
let v = Value::Int(42);
assert_eq!(v.as_string(), "42");

Trait Implementations

impl<'c> Debug for Value<'c>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'c> Clone for Value<'c>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'c> Eq for Value<'c>
[src]

impl<'c> PartialEq for Value<'c>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'c> Ord for Value<'c>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<'c> PartialOrd for Value<'c>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'c> Display for Value<'c>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'c> Send for Value<'c>

impl<'c> Sync for Value<'c>