mirror of https://github.com/AMT-Cheif/drift.git
Remove unnecessary where for batch.deleteAll
This commit is contained in:
parent
6e16a8b8b6
commit
d165ee1bd8
|
@ -147,8 +147,11 @@ class Batch {
|
||||||
///
|
///
|
||||||
/// See also:
|
/// See also:
|
||||||
/// - [DatabaseConnectionUser.delete]
|
/// - [DatabaseConnectionUser.delete]
|
||||||
void deleteAll<T extends Table, D>(TableInfo<T, D> table) =>
|
void deleteAll<T extends Table, D>(TableInfo<T, D> table) {
|
||||||
deleteWhere(table, (tbl) => const Constant(true));
|
_addUpdate(table, UpdateKind.delete);
|
||||||
|
final stmt = DeleteStatement(_user, table);
|
||||||
|
_addContext(stmt.constructQuery());
|
||||||
|
}
|
||||||
|
|
||||||
/// Executes the custom [sql] statement with variables instantiated to [args].
|
/// Executes the custom [sql] statement with variables instantiated to [args].
|
||||||
///
|
///
|
||||||
|
|
|
@ -59,7 +59,7 @@ void main() {
|
||||||
'UPDATE "users" SET "name" = ? WHERE "name" = ?;',
|
'UPDATE "users" SET "name" = ? WHERE "name" = ?;',
|
||||||
'UPDATE "categories" SET "desc" = ?, "priority" = 0 WHERE "id" = ?;',
|
'UPDATE "categories" SET "desc" = ?, "priority" = 0 WHERE "id" = ?;',
|
||||||
'DELETE FROM "categories" WHERE "id" = ?;',
|
'DELETE FROM "categories" WHERE "id" = ?;',
|
||||||
'DELETE FROM "categories" WHERE 1;',
|
'DELETE FROM "categories";',
|
||||||
'DELETE FROM "todos" WHERE "id" = ?;',
|
'DELETE FROM "todos" WHERE "id" = ?;',
|
||||||
'some custom statement',
|
'some custom statement',
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue