InsertStatement<Row extends Object, RS extends GeneratedTable<Row, RS>> class final

An INSERT statement in SQL.

Inheritance

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 RETURNING clause 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 UPDATE clause added to this statement.
getter/setter pair

Methods

compileWith(StatementCompiler compiler) → void
Compiles this component with the given StatementCompiler by invoking the relevant add method on it.
override
fromSelect(BaseSelectStatement<BaseSelectStatement, dynamic> select, {required Map<TableColumn<Object>, Expression<Object>> columns}) → InsertStatement<Row, RS>
Inserts rows from the select statement.
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<Object>, Expression<Object>> columns, UpsertClause<Row, RS>? onConflict}) → Future<QueryResult>
Inserts rows from the select statement.
insertOnConflictUpdate(Insertable<Row> entity) → Future<int>
Attempts to insert entity into the database. If the insert would violate a primary key or uniqueness constraint, updates the columns that are present on entity.
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 upsert clause to this insert statement.
returningAll() → void
Adds a RETURNING * clause to this insert statement.
inherited
returningOnly(List<Expression<Object>> expressions) → void
Adds a RETURNING clause returning the given expressions which are evaluated against each row affected by this statement.
inherited
runReturning() → Future<List<Row>>
Runs this insert statement with a RETURNING clause, returning inserted rows.
runReturningOnly(List<Expression<Object>> expressions) → Future<List<DriftRow>>
Runs this insert statement with a RETURNING clause, 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