This commit is contained in:
yifeng.yl
2019-05-07 15:41:22 +08:00
parent 4df5288940
commit 4ac0bc2ed6
12 changed files with 181 additions and 28 deletions

View File

@ -1,4 +1,4 @@
import 'dart:async';
import 'package:sqflite/sqflite.dart';
@ -31,6 +31,10 @@ class Sql extends BaseModel {
return await this.db.delete(tableName,where:'$key = ?',whereArgs:[value]);
}
Future<int> deleteAll() async{
return await this.db.delete(tableName);
}
Future<List> getByCondition({Map<dynamic, dynamic> conditions}) async {
if (conditions == null || conditions.isEmpty) {
return this.get();