Enum DBImpl

Source
pub enum DBImpl {
    SQLite,
    Postgres,
    MySQL,
}
Expand description

The main interface for creating sql strings

Variants§

§

SQLite

Available on crate feature sqlite only.

Implementation of SQLite

§

Postgres

Available on crate feature postgres only.

Implementation of Postgres

§

MySQL

Available on crate feature mysql only.

Implementation of MySQL / MariaDB

Implementations§

Source§

impl DBImpl

Source

pub fn create_table<'until_build, 'post_build>( &self, name: &'until_build str, ) -> impl CreateTable<'until_build, 'post_build>
where 'post_build: 'until_build,

The entry point to create a table.

Parameter:

  • name: Name of the table
Source

pub fn create_trigger( &self, name: &str, table_name: &str, point_in_time: Option<SQLCreateTriggerPointInTime>, operation: SQLCreateTriggerOperation, ) -> SQLCreateTrigger

The entry point to create a trigger.

Parameter:

Source

pub fn create_index<'until_build>( &self, name: &'until_build str, table_name: &'until_build str, ) -> impl CreateIndex<'until_build>

The entry point to create an index.

Parameter:

  • name: Name of the index.
  • table_name: Table to create the index on.
Source

pub fn drop_table<'until_build>( &self, name: &'until_build str, ) -> impl DropTable + 'until_build

The entry point to drop a table.

Parameter:

  • name: Name of the table to drop.
Source

pub fn alter_table<'until_build, 'post_build>( &self, name: &'until_build str, operation: AlterTableOperation<'until_build, 'post_build>, ) -> impl AlterTable<'post_build> + 'until_build
where 'post_build: 'until_build,

The entry point to alter a table.

Parameter:

  • name: Name of the table to execute the operation on.
  • operation: AlterTableOperation: The operation to execute.
Source

pub fn create_column<'until_build, 'post_build>( &self, table_name: &'until_build str, name: &'until_build str, data_type: DbType, annotations: &'post_build [Annotation], ) -> CreateColumnImpl<'until_build, 'post_build>

The entry point to create a column in a table.

Parameter:

  • table_name: Name of the table.
  • name: Name of the column.
  • data_type: DbType: Data type of the column
  • annotations: slice of Annotation: List of annotations.
Source

pub fn select<'until_build, 'post_build>( &self, columns: &'until_build [SelectColumnImpl<'_>], from_clause: &'until_build str, joins: &'until_build [JoinTableImpl<'until_build, 'post_build>], order_by_clause: &'until_build [OrderByEntry<'until_build>], ) -> impl Select<'until_build, 'post_build>

Build a select query.

Parameter:

  • columns: The columns to select.
  • from_clause: Specifies from what to select. This can be a table name or another query itself.
  • joins: List of join tables.
Source

pub fn insert<'until_build, 'post_build>( &self, into_clause: &'until_build str, insert_columns: &'until_build [&'until_build str], insert_values: &'until_build [&'until_build [Value<'post_build>]], returning_clause: Option<&'until_build [&'until_build str]>, ) -> impl Insert<'post_build> + 'until_build
where 'post_build: 'until_build,

Build an INSERT query.

Parameter:

  • into_clause: The table to insert into.
  • insert_columns: The column names to insert into.
  • insert_values: slice of slice of Value: The values to insert.
  • returning_clause: Optional slice of string to retrieve after the insert.
Source

pub fn delete<'until_build, 'post_query>( &self, table_name: &'until_build str, ) -> impl Delete<'until_build, 'post_query>
where 'post_query: 'until_build,

Build a delete operation.

Parameter:

  • table_name: Name of the table to delete from.
Source

pub fn update<'until_build, 'post_query>( &self, table_name: &'until_build str, ) -> impl Update<'until_build, 'post_query>
where 'post_query: 'until_build,

Build an update operation.

Parameter:

  • table_name: Name of the table the updates should be executed for.
Source

pub fn join_table<'until_build, 'post_query>( &self, join_type: JoinType, table_name: &'until_build str, join_alias: &'until_build str, join_condition: Cow<'until_build, Condition<'post_query>>, ) -> JoinTableImpl<'until_build, 'post_query>

The entry point for a JOIN expression builder.

Parameter:

  • join_type: JoinType: Type for a JOIN expression
  • table_name: Table to perform the join on
  • join_alias: Alias for the join table
  • join_condition: Condition to apply to the join
Source

pub fn select_column<'until_build>( &self, table_name: Option<&'until_build str>, column_name: &'until_build str, select_alias: Option<&'until_build str>, aggregation: Option<SelectAggregator>, ) -> SelectColumnImpl<'until_build>

The entry point for a column selector builder.

Parameter:

  • table_name: Optional table name
  • column_name: Name of the column
  • select_alias: Alias for the selector
  • aggregation: Optional aggregation function

Trait Implementations§

Source§

impl Clone for DBImpl

Source§

fn clone(&self) -> DBImpl

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DBImpl

Auto Trait Implementations§

§

impl Freeze for DBImpl

§

impl RefUnwindSafe for DBImpl

§

impl Send for DBImpl

§

impl Sync for DBImpl

§

impl Unpin for DBImpl

§

impl UnwindSafe for DBImpl

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.