InsertStatement<Row extends Object, RS extends GeneratedTable<Row, RS> > class
final
An INSERT statement in SQL.
- Inheritance
-
- Object
- SqlStatement
- StatementWithReturningClause<
Row, RS> - InsertStatement
Constructors
-
InsertStatement(DatabaseConnectionUser _database, GeneratedTable<
Row, RS> table) - Constructs an insert statement from the database and the table. Used internally by drift.
Properties
-
dialectSpecificOptions
→ Map<
Symbol, Object?> -
A map of dialect-specific options.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- returning ↔ ReturningClause?
-
An optional
RETURNINGclause part of this statement.getter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source ↔ InsertSource?
-
The values to use for the rows being inserted.
getter/setter pair
-
table
→ GeneratedTable<
Row, RS> -
The primary table affected by this statement.
finalinherited
-
upsertClause
↔ UpsertClause<
Row, RS> ? -
An
ON CONFLICT DO UPDATEclause added to this statement.getter/setter pair
Methods
-
compileWith(
StatementCompiler compiler) → void -
Compiles this component with the given StatementCompiler by invoking the
relevant
addmethod on it.override -
fromSelect(
BaseSelectStatement< BaseSelectStatement, dynamic> select, {required Map<TableColumn< columns}) → InsertStatement<Object> , Expression<Object> >Row, RS> -
Inserts rows from the
selectstatement. -
insert(
Insertable< Row> entity, {UpsertClause<Row, RS> ? onConflict}) → Future<int> -
Inserts a row constructed from the fields in
entity. -
insertFromSelect(
BaseSelectStatement< BaseSelectStatement, dynamic> select, {required Map<TableColumn< columns, UpsertClause<Object> , Expression<Object> >Row, RS> ? onConflict}) → Future<QueryResult> -
Inserts rows from the
selectstatement. -
insertOnConflictUpdate(
Insertable< Row> entity) → Future<int> -
Attempts to insert
entityinto the database. If the insert would violate a primary key or uniqueness constraint, updates the columns that are present onentity. -
insertReturning(
Insertable< Row> entity, {UpsertClause<Row, RS> ? onConflict}) → Future<Row> - Inserts a row into the table and returns it.
-
insertReturningOrNull(
Insertable< Row> entity, {UpsertClause<Row, RS> ? onConflict}) → Future<Row?> - Inserts a row into the table and returns it.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onConflict(
UpsertClause< Row, RS> upsert) → InsertStatement<Row, RS> -
Adds an
upsertclause to this insert statement. -
returningAll(
) → void -
Adds a
RETURNING *clause to this insert statement.inherited -
returningOnly(
List< Expression< expressions) → voidObject> > -
Adds a
RETURNINGclause returning the givenexpressionswhich are evaluated against each row affected by this statement.inherited -
runReturning(
) → Future< List< Row> > -
Runs this insert statement with a
RETURNINGclause, returning inserted rows. -
runReturningOnly(
List< Expression< expressions) → Future<Object> >List< DriftRow> > -
Runs this insert statement with a
RETURNINGclause, returning [expressions} of inserted rows. -
toString(
) → String -
A string representation of this object.
inherited
-
values(
Insertable< Row> row) → InsertStatement<Row, RS> -
Configures this insert statement to insert values from the Dart object
row.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited