UpdateStatement<T extends Table, D> class
Represents an UPDATE statement in sql.
- Inheritance
- Mixed-in types
-
- SingleTableQueryMixin<
T, D>
- SingleTableQueryMixin<
- Available extensions
Constructors
-
UpdateStatement(DatabaseConnectionUser database, TableInfo<
T, D> table) - Used internally by drift, construct an update statement
Properties
- database ↔ DatabaseConnectionUser
-
The database this statement should be sent to.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- limitExpr ↔ Limit?
-
The
LIMITclause for this statement.getter/setter pairinherited - orderByExpr ↔ OrderBy?
-
The
ORDER BYclause for this statementgetter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
table
↔ ResultSetImplementation<
T, D> -
The (main) table or view that this query operates on.
getter/setter pairinherited
- whereExpr ↔ Where?
-
The
WHEREclause for this statementgetter/setter pairinherited - writeReturningClause ↔ bool
-
Whether a
RETURNING *clause should be added to this statement.getter/setter pairinherited
Methods
-
constructQuery(
) → GenerationContext -
Constructs the query that can then be sent to the database executor.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replace(
Insertable< D> entity, {bool dontExecute = false}) → Future<bool> -
Replaces the old version of
entitythat is stored in the database with the fields of theentityprovided here. This implicitly applies a where clause to rows with the same primary key asentity, so that only the row representing outdated data will be replaced. -
toString(
) → String -
A string representation of this object.
inherited
-
where(
Expression< bool> filter(T tbl)) → void -
Makes this statement only include rows that match the
filter.inherited -
whereSamePrimaryKey(
Insertable< D> d) → void -
Available on SingleTableQueryMixin<
Applies a where statement so that the row with the same primary key asT, D> , provided by the QueryTableExtensions extensiondwill be matched. -
write(
Insertable< D> entity, {bool dontExecute = false}) → Future<int> -
Writes all non-null fields from
entityinto the columns of all rows that match the where clause. Warning: That also means that, when you're not setting a where clause explicitly, this method will update all rows in the table. -
writeInto(
GenerationContext context) → void -
Writes this component into the
contextby writing to its GenerationContext.buffer or by introducing bound variables. When writing into the buffer, no whitespace around the this component should be introduced. When a component consists of multiple composed component, it's responsible for introducing whitespace between its child components.inherited -
writeReturning(
Insertable< D> entity) → Future<List< D> > -
Applies the updates from
entityto all rows matching the appliedwhereclause and returns affected rows after the update. -
writeStartPart(
GenerationContext ctx) → void -
Subclasses must override this and write the part of the statement that
comes before the where and limit expression..
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited