mirror of https://github.com/AMT-Cheif/drift.git
add tests for bulk replace
This commit is contained in:
parent
1a68efce58
commit
4c4122f52c
|
@ -105,6 +105,24 @@ void main() {
|
||||||
.then((value) => value.description),
|
.then((value) => value.description),
|
||||||
completion("Hello"));
|
completion("Hello"));
|
||||||
|
|
||||||
|
// Bulk Replace
|
||||||
|
await db.managers.categories.bulkReplace([
|
||||||
|
obj1.copyWith(description: "Hello"),
|
||||||
|
obj2.copyWith(description: "World")
|
||||||
|
]);
|
||||||
|
expect(
|
||||||
|
db.managers.categories
|
||||||
|
.filter(((f) => f.id(obj1.id)))
|
||||||
|
.getSingle()
|
||||||
|
.then((value) => value.description),
|
||||||
|
completion("Hello"));
|
||||||
|
expect(
|
||||||
|
db.managers.categories
|
||||||
|
.filter(((f) => f.id(obj2.id)))
|
||||||
|
.getSingle()
|
||||||
|
.then((value) => value.description),
|
||||||
|
completion("World"));
|
||||||
|
|
||||||
// Update All Rows
|
// Update All Rows
|
||||||
final update2 = db.managers.categories
|
final update2 = db.managers.categories
|
||||||
.update((o) => o(priority: Value(CategoryPriority.high)));
|
.update((o) => o(priority: Value(CategoryPriority.high)));
|
||||||
|
|
Loading…
Reference in New Issue