pub type InsertBuilder<'a, Schema, State, Table> = QueryBuilder<'a, Schema, State, Table>;Expand description
Builds an INSERT query specifically for PostgreSQL
Aliased Type§
pub struct InsertBuilder<'a, Schema, State, Table> {
pub sql: SQL<'a, PostgresValue<'a>>,
/* private fields */
}Fields§
§sql: SQL<'a, PostgresValue<'a>>Implementations§
Source§impl<'a, Schema, Table> InsertBuilder<'a, Schema, InsertInitial, Table>where
Table: PostgresTable<'a>,
impl<'a, Schema, Table> InsertBuilder<'a, Schema, InsertInitial, Table>where
Table: PostgresTable<'a>,
Sourcepub fn values<I, T>(
self,
values: I,
) -> InsertBuilder<'a, Schema, InsertValuesSet, Table>where
I: IntoIterator<Item = Table::Insert<T>>,
pub fn values<I, T>(
self,
values: I,
) -> InsertBuilder<'a, Schema, InsertValuesSet, Table>where
I: IntoIterator<Item = Table::Insert<T>>,
Sets values to insert and transitions to ValuesSet state
Source§impl<'a, S, T> InsertBuilder<'a, S, InsertValuesSet, T>
impl<'a, S, T> InsertBuilder<'a, S, InsertValuesSet, T>
Sourcepub fn on_conflict(
self,
conflict: Conflict<'a>,
) -> InsertBuilder<'a, S, InsertOnConflictSet, T>
pub fn on_conflict( self, conflict: Conflict<'a>, ) -> InsertBuilder<'a, S, InsertOnConflictSet, T>
Adds conflict resolution clause following PostgreSQL ON CONFLICT syntax
Sourcepub fn on_conflict_do_nothing(
self,
) -> InsertBuilder<'a, S, InsertOnConflictSet, T>
pub fn on_conflict_do_nothing( self, ) -> InsertBuilder<'a, S, InsertOnConflictSet, T>
Shorthand for ON CONFLICT DO NOTHING (matches any conflict)
Sourcepub fn on_conflict_do_nothing_on<C>(
self,
columns: C,
) -> InsertBuilder<'a, S, InsertOnConflictSet, T>where
C: ToSQL<'a, PostgresValue<'a>>,
pub fn on_conflict_do_nothing_on<C>(
self,
columns: C,
) -> InsertBuilder<'a, S, InsertOnConflictSet, T>where
C: ToSQL<'a, PostgresValue<'a>>,
Shorthand for ON CONFLICT (columns…) DO NOTHING
Sourcepub fn returning(
self,
columns: impl ToSQL<'a, PostgresValue<'a>>,
) -> InsertBuilder<'a, S, InsertReturningSet, T>
pub fn returning( self, columns: impl ToSQL<'a, PostgresValue<'a>>, ) -> InsertBuilder<'a, S, InsertReturningSet, T>
Adds a RETURNING clause and transitions to ReturningSet state
Source§impl<'a, S, T> InsertBuilder<'a, S, InsertOnConflictSet, T>
impl<'a, S, T> InsertBuilder<'a, S, InsertOnConflictSet, T>
Sourcepub fn returning(
self,
columns: impl ToSQL<'a, PostgresValue<'a>>,
) -> InsertBuilder<'a, S, InsertReturningSet, T>
pub fn returning( self, columns: impl ToSQL<'a, PostgresValue<'a>>, ) -> InsertBuilder<'a, S, InsertReturningSet, T>
Adds a RETURNING clause after ON CONFLICT