InsertStatement<T extends Table, D> class
Represents an insert statement
Constructors
-
InsertStatement(DatabaseConnectionUser database, TableInfo<
T, D> table) - Constructs an insert statement from the database and the table. Used internally by drift.
Properties
- database → DatabaseConnectionUser
-
The database to use then executing this statement
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
table
→ TableInfo<
T, D> -
The table we're inserting into
final
Methods
-
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 themode
. -
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< columns, InsertMode mode = InsertMode.insert, UpsertClause<Object> , Expression<Object> >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 onentity
. -
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.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeInsertable(
GenerationContext ctx, Map< String, Expression< map) → voidObject> > -
Writes column names and values from the
map
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited