Struct Pg

Source
pub struct Pg;
Expand description

Postgres SQL generator backend

Trait Implementations§

Source§

impl SqlGenerator for Pg

Source§

fn create_table(name: &str, schema: Option<&str>) -> String

Create a new table with a name
Source§

fn create_table_if_not_exists(name: &str, schema: Option<&str>) -> String

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

fn drop_table(name: &str, schema: Option<&str>) -> String

Drop a table with a name
Source§

fn drop_table_if_exists(name: &str, schema: Option<&str>) -> String

Drop a table with a name, only if it exists
Source§

fn rename_table(old: &str, new: &str, schema: Option<&str>) -> String

Rename a table from to
Source§

fn alter_table(name: &str, schema: Option<&str>) -> String

Modify a table in some other way
Source§

fn add_column(ex: bool, schema: Option<&str>, name: &str, tt: &Type) -> String

Create a new column with a type
Source§

fn drop_column(name: &str) -> String

Drop an existing column from the table
Source§

fn rename_column(old: &str, new: &str) -> String

Rename an existing column
Source§

fn create_index( table: &str, schema: Option<&str>, name: &str, _type: &Type, ) -> String

Create a multi-column index
Source§

fn create_constraint(name: &str, _type: &Type) -> String

Create a constraint
Source§

fn drop_index(name: &str) -> String

Drop a multi-column index
Source§

fn add_foreign_key( columns: &[String], table: &str, relation_columns: &[String], schema: Option<&str>, ) -> String

Add a foreign key
Source§

fn add_primary_key(columns: &[String]) -> String

Source§

fn create_partial_index( table: &str, schema: Option<&str>, name: &str, _type: &Type, conditions: &str, ) -> String

Create a multi-column index

Auto Trait Implementations§

§

impl Freeze for Pg

§

impl RefUnwindSafe for Pg

§

impl Send for Pg

§

impl Sync for Pg

§

impl Unpin for Pg

§

impl UnwindSafe for Pg

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.