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

pub trait SqlGenerator {
Show 15 methods fn create_table(name: &str, schema: Option<&str>) -> String;
fn create_table_if_not_exists(name: &str, schema: Option<&str>) -> String;
fn drop_table(name: &str, schema: Option<&str>) -> String;
fn drop_table_if_exists(name: &str, schema: Option<&str>) -> String;
fn rename_table(old: &str, new: &str, schema: Option<&str>) -> String;
fn alter_table(name: &str, schema: Option<&str>) -> String;
fn add_column(
        ex: bool,
        schema: Option<&str>,
        name: &str,
        _type: &Type
    ) -> String;
fn drop_column(name: &str) -> String;
fn rename_column(old: &str, new: &str) -> String;
fn create_index(
        table: &str,
        schema: Option<&str>,
        name: &str,
        _type: &Type
    ) -> String;
fn create_constraint(name: &str, _type: &Type) -> String;
fn drop_index(name: &str) -> String;
fn add_foreign_key(
        columns: &[String],
        table: &str,
        relation_columns: &[String],
        schema: Option<&str>
    ) -> String;
fn add_primary_key(columns: &[String]) -> String; fn create_partial_index(
        table: &str,
        schema: Option<&str>,
        name: &str,
        _type: &Type,
        conditions: &str
    ) -> String { ... }
}
Expand description

A generic SQL generator trait

Required methods

Create a new table with a name

Create a new table with a name, only if it doesn’t exist

Drop a table with a name

Drop a table with a name, only if it exists

Rename a table from to

Modify a table in some other way

Create a new column with a type

Drop an existing column from the table

Rename an existing column

Create a multi-column index

Create a constraint

Drop a multi-column index

Add a foreign key

Provided methods

Create a multi-column index

Implementors