Batch class

A batch is used to perform multiple operation as a single atomic unit. A Batch object can be acquired by calling Database.batch. It provides methods for adding operation. None of the operation will be executed (or visible locally) until commit() is called.

batch = db.batch();
batch.insert('Test', {'name': 'item'});
batch.update('Test', {'name': 'new_item'}, where: 'name = ?', whereArgs: ['item']);
batch.delete('Test', where: 'name = ?', whereArgs: ['item']);
results = await batch.commit();




hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


commit({bool exclusive, bool noResult, bool continueOnError}) Future<List>
Commits all of the operations in this batch as a single atomic unit The result is a list of the result of each operation in the same order if noResult is true, the result list is empty (i.e. the id inserted the count of item changed is not returned. [...]
delete(String table, {String where, List whereArgs}) → void
See Database.delete
execute(String sql, [List arguments]) → void
See Database.execute;
insert(String table, Map<String, dynamic> values, {String nullColumnHack, ConflictAlgorithm conflictAlgorithm}) → void
See Database.insert
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
query(String table, {bool distinct, List<String> columns, String where, List whereArgs, String groupBy, String having, String orderBy, int limit, int offset}) → void
See Database.query;
rawDelete(String sql, [List arguments]) → void
See Database.rawDelete
rawInsert(String sql, [List arguments]) → void
See Database.rawInsert
rawQuery(String sql, [List arguments]) → void
See Database.query;
rawUpdate(String sql, [List arguments]) → void
See Database.rawUpdate
toString() String
A string representation of this object. [...]
update(String table, Map<String, dynamic> values, {String where, List whereArgs, ConflictAlgorithm conflictAlgorithm}) → void
See Database.update


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