Struct barrel::table::Table [−][src]
pub struct Table {
pub meta: TableMeta,
// some fields omitted
}
Fields
meta: TableMeta
Implementations
Add a new column to a table
table.add_column("id", types::primary());
table.add_column("name", types::varchar(64));
Inject a line of custom SQL into the table block
This is a bypass to the barrel typesystem, in case there is something your database supports that barrel doesn’t, or if there is an issue with the way that barrel represents types. It does however mean that the SQL provided needs to be specific for one database, meaning that future migrations might become cumbersome.
Add a new index to a table, spanning over multiple columns
Drop an index on this table
pub fn add_foreign_key(
&mut self,
columns_on_this_side: &[&str],
related_table: &str,
columns_on_that_side: &[&str]
)
Generate Sql for this table.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Table
impl !UnwindSafe for Table
Blanket Implementations
Mutably borrows from an owned value. Read more