[−][src]Enum barrel::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<Type> for Type
[src]
impl Clone for Type
[src]
fn clone(&self) -> Type
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Type
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
Convert self
to an expression for Diesel's query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel's query builder. Read more