Enum barrel::Type [] [src]

pub enum Type {
    Text,
    Varchar(usize),
    Primary,
    Integer,
    Float,
    Double,
    Boolean,
    Binary,
    Foreign(&'static str),
    Array(Box<Type>),
}

Type enum to specificy the type of an SQL column. NOTE: Not all types are supported by all database backends!

When creating a column users need to specify the type and potential metadata this type requires to the add_column function.

t.add_column("posts", Type::Array(box Type::Foreign("posts")));

Variants

Create a simple "text" field

Provide a size limit for this field

Create a primary key regardless of database

This type is more of a convenience wrapper around other (64-bit) integer types. It might be changed at some point or just removed.

Be careful when using this type!

Creates a 64-bit integer

Creates a 32-bit float

Creates a 64-bit float

Boring ol' boolean

Create a simple "binary" field

Provide the name of a table to point to

Any type can also exist as an array type

Trait Implementations

impl PartialEq for Type
[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 Debug for Type
[src]

[src]

Formats the value using the given formatter.

impl Clone for Type
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more