Trait barrel::backend::SqlGenerator
[−]
[src]
pub trait SqlGenerator { fn create_table(name: &str) -> String; fn create_table_if_not_exists(name: &str) -> String; fn drop_table(name: &str) -> String; fn drop_table_if_exists(name: &str) -> String; fn rename_table(old: &str, new: &str) -> String; fn alter_table(name: &str) -> String; fn add_column(ex: bool, name: &str, column: &Column) -> String; fn drop_column(name: &str) -> String; fn rename_column(old: &str, new: &str) -> String; }
A generic SQL generator trait
Required Methods
fn create_table(name: &str) -> String
Create a new table with a name
fn create_table_if_not_exists(name: &str) -> String
Create a new table with a name, only if it doesn't exist
fn drop_table(name: &str) -> String
Drop a table with a name
fn drop_table_if_exists(name: &str) -> String
Drop a table with a name, only if it exists
fn rename_table(old: &str, new: &str) -> String
Rename a table from
fn alter_table(name: &str) -> String
Modify a table in some other way
fn add_column(ex: bool, name: &str, column: &Column) -> String
Create a new column with a type
fn drop_column(name: &str) -> String
Drop an existing column from the table
fn rename_column(old: &str, new: &str) -> String
Rename an existing column
Implementors
impl SqlGenerator for Pg