diff --git a/moor/lib/src/runtime/query_builder/statements/insert.dart b/moor/lib/src/runtime/query_builder/statements/insert.dart index 70811bb3..70f2dacb 100644 --- a/moor/lib/src/runtime/query_builder/statements/insert.dart +++ b/moor/lib/src/runtime/query_builder/statements/insert.dart @@ -325,6 +325,11 @@ class DoUpdate extends UpsertClause { /// If you need to refer to both the old row and the row that would have /// been inserted, use [DoUpdate.withExcluded]. /// + /// The optional [where] clause can be used to + /// disable the update based on the old value. + /// If a [where] clause is set and it evaluates to false, + /// a conflict will keep the old row without applying the update + /// /// For an example, see [InsertStatement.insert]. DoUpdate(Insertable Function(T old) update, {this.target, Expression Function(T old)? where}) @@ -339,7 +344,12 @@ class DoUpdate extends UpsertClause { /// It can refer to the values from the old row in the first parameter and /// to columns in the row that couldn't be inserted with the `excluded` /// parameter. - /// + /// + /// The optional [where] clause can be used to + /// disable the update based on the old value. + /// If a [where] clause is set and it evaluates to false, + /// a conflict will keep the old row without applying the update + /// /// For an example, see [InsertStatement.insert]. DoUpdate.withExcluded(this._creator, {this.target, Expression Function(T old, T excluded)? where})