customUpdate method
Future<int>
customUpdate(
- String query, {
- List<
Variable< variables = const [],Object> > - Set<
ResultSetImplementation> ? updates, - UpdateKind? updateKind,
inherited
Executes a custom delete or update statement and returns the amount of
rows that have been changed.
You can use the updates
parameter so that drift knows which tables are
affected by your query. All select streams that depend on a table
specified there will then update their data. For more accurate results,
you can also set the updateKind
parameter to UpdateKind.delete
or
UpdateKind.update
. This is optional, but can improve the accuracy of
query updates, especially when using triggers.
Implementation
Future<int> customUpdate(
String query, {
List<Variable> variables = const [],
Set<ResultSetImplementation>? updates,
UpdateKind? updateKind,
}) async {
return _customWrite(
query,
variables,
updates,
updateKind,
(executor, sql, vars) {
return executor.runUpdate(sql, vars);
},
);
}