pub enum DBImpl {
SQLite,
Postgres,
MySQL,
}
Expand description
The main interface for creating sql strings
Variants§
SQLite
Implementation of SQLite
Postgres
Implementation of Postgres
MySQL
Implementation of MySQL / MariaDB
Implementations§
source§impl DBImpl
impl DBImpl
sourcepub fn create_table<'until_build, 'post_build>(
&self,
name: &'until_build str
) -> impl CreateTable<'until_build, 'post_build>where
'post_build: 'until_build,
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
sourcepub fn create_trigger(
&self,
name: &str,
table_name: &str,
point_in_time: Option<SQLCreateTriggerPointInTime>,
operation: SQLCreateTriggerOperation
) -> SQLCreateTrigger
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:
name
: Name of the trigger.table_name
: Name of the table to create the trigger on.point_in_time
: Option of SQLCreateTriggerPointInTime: When to execute the trigger.operation
: SQLCreateTriggerOperation: The operation that invokes the trigger.
sourcepub fn create_index<'until_build>(
&self,
name: &'until_build str,
table_name: &'until_build str
) -> impl CreateIndex<'until_build>
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.
sourcepub fn drop_table<'until_build>(
&self,
name: &'until_build str
) -> impl DropTable + 'until_build
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.
sourcepub fn alter_table<'until_build, 'post_build>(
&self,
name: &'until_build str,
operation: AlterTableOperation<'until_build, 'post_build>
) -> impl AlterTable<'post_build> + 'until_buildwhere
'post_build: 'until_build,
pub fn alter_table<'until_build, 'post_build>( &self, name: &'until_build str, operation: AlterTableOperation<'until_build, 'post_build> ) -> impl AlterTable<'post_build> + 'until_buildwhere '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.
sourcepub 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>
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 columnannotations
: slice of Annotation: List of annotations.
sourcepub 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>
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.
sourcepub 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_buildwhere
'post_build: 'until_build,
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_buildwhere '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.
sourcepub fn delete<'until_build, 'post_query>(
&self,
table_name: &'until_build str
) -> impl Delete<'until_build, 'post_query>
pub fn delete<'until_build, 'post_query>( &self, table_name: &'until_build str ) -> impl Delete<'until_build, 'post_query>
Build a delete operation.
Parameter:
table_name
: Name of the table to delete from.
sourcepub fn update<'until_build, 'post_query>(
&self,
table_name: &'until_build str
) -> impl Update<'until_build, 'post_query>
pub fn update<'until_build, 'post_query>( &self, table_name: &'until_build str ) -> impl Update<'until_build, 'post_query>
Build an update operation.
Parameter:
table_name
: Name of the table the updates should be executed for.
sourcepub fn join_table<'until_build, 'post_query>(
&self,
join_type: JoinType,
table_name: &'until_build str,
join_alias: &'until_build str,
join_condition: &'until_build Condition<'post_query>
) -> JoinTableImpl<'until_build, 'post_query>
pub fn join_table<'until_build, 'post_query>( &self, join_type: JoinType, table_name: &'until_build str, join_alias: &'until_build str, join_condition: &'until_build Condition<'post_query> ) -> JoinTableImpl<'until_build, 'post_query>
sourcepub 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>
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 namecolumn_name
: Name of the columnselect_alias
: Alias for the selectoraggregation
: Optional aggregation function