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