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
Text
Create a simple "text" field
Varchar(usize)
Provide a size limit for this field
Primary
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!
Integer
Creates a 64-bit integer
Float
Creates a 32-bit float
Double
Creates a 64-bit float
Boolean
Boring ol' boolean
Binary
Create 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]
fn eq(&self, __arg_0: &Type) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Type) -> bool
[src]
This method tests for !=
.
impl Debug for Type
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more