[−][src]Struct barrel::table::Table
Fields
meta: TableMeta
Methods
impl Table
[src]
pub fn new<S: Into<String>>(name: S) -> Self
[src]
pub fn add_column<S: Into<String>>(&mut self, name: S, _type: Type) -> &mut Type
[src]
Add a new column to a table
table.add_column("id", types::primary()); table.add_column("name", types::varchar(64));
pub fn drop_column<S: Into<String>>(&mut self, name: S)
[src]
pub fn rename_column<S: Into<String>>(&mut self, old: S, new: S)
[src]
pub fn inject_custom<S: Into<String>>(&mut self, sql: S)
[src]
pub fn add_index<S: Into<String>>(&mut self, name: S, columns: Type)
[src]
Add a new index to a table, spanning over multiple columns
pub fn drop_index<S: Into<String>>(&mut self, name: S)
[src]
Drop an index on this table
pub fn make<T: SqlGenerator>(
&mut self,
ex: bool,
schema: Option<&str>
) -> (Vec<String>, Vec<String>)
[src]
&mut self,
ex: bool,
schema: Option<&str>
) -> (Vec<String>, Vec<String>)
Generate Sql for this table, returned as two vectors
The first vector (.0
) represents all column changes done to the table,
the second vector (.1
) contains all index and suffix changes.
It is very well possible for either of them to be empty, although both being empty might signify an error.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Table
impl !Send for Table
impl !Sync for Table
impl Unpin for Table
impl !UnwindSafe for Table
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,