InsertStatement<T extends Table, D> class

Represents an insert statement


InsertStatement(DatabaseConnectionUser database, TableInfo<T, D> table)
Constructs an insert statement from the database and the table. Used internally by drift.


database DatabaseConnectionUser
The database to use then executing this statement
hashCode int
The hash code for this object.
runtimeType Type
A representation of the runtime type of the object.
table TableInfo<T, D>
The table we're inserting into


createContext(Insertable<D> entry, InsertMode mode, {UpsertClause<T, D>? onConflict, bool returning = false}) GenerationContext
Creates a GenerationContext which contains the sql necessary to run an insert statement fro the entry with the mode.
insert(Insertable<D> entity, {InsertMode? mode, UpsertClause<T, D>? onConflict}) Future<int>
Inserts a row constructed from the fields in entity.
insertFromSelect(BaseSelectStatement select, {required Map<Column<Object>, Expression<Object>> columns, InsertMode mode = InsertMode.insert, UpsertClause<T, D>? onConflict}) Future<void>
Inserts rows from the select statement.
insertOnConflictUpdate(Insertable<D> 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<D> entity, {InsertMode? mode, UpsertClause<T, D>? onConflict}) Future<D>
Inserts a row into the table and returns it.
insertReturningOrNull(Insertable<D> entity, {InsertMode? mode, UpsertClause<T, D>? onConflict}) Future<D?>
Inserts a row into the table and returns it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.
writeInsertable(GenerationContext ctx, Map<String, Expression<Object>> map) → void
Writes column names and values from the map.


operator ==(Object other) bool
The equality operator.