Enum barrel::Type [−][src]
pub enum Type {
Text,
Varchar(usize),
Primary,
Integer,
Float,
Double,
Boolean,
Binary,
Foreign(&'static str),
Custom(&'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
TextCreate a simple "text" field
Varchar(usize)Provide a size limit for this field
PrimaryCreate 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!
IntegerCreates a 64-bit integer
FloatCreates a 32-bit float
DoubleCreates a 64-bit float
BooleanBoring ol' boolean
BinaryCreate a simple "binary" field
Foreign(&'static str)Provide the name of a table to point to
Custom(&'static str)Used for types not Implemented by the migration system. This field is not statically checked.
Array(Box<Type>)Any type can also exist as an array type
Trait Implementations
impl PartialEq for Type[src]
impl PartialEq for Typefn eq(&self, other: &Type) -> bool[src]
fn eq(&self, other: &Type) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Type) -> bool[src]
fn ne(&self, other: &Type) -> boolThis method tests for !=.
impl Debug for Type[src]
impl Debug for Typefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Type[src]
impl Clone for Type