[][src]Trait barrel::backend::SqlGenerator

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 to

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

Loading content...

Implementors

impl SqlGenerator for Pg[src]

impl SqlGenerator for Sqlite[src]

Loading content...