BaseDao<T extends BaseDbModel> class
abstract
@date 27/4/22 describe: @author:Barry
Properties
Methods
-
addColumn(
String field) → void - add the new column for table, the filed just like 'name Text'
-
clear(
[String? tableName]) → Future< void> - 清空表所有数据
-
composeIds(
List< Object?> ? datas) → String - 组装Ids
-
delete(
T? t, [String? tableName]) → Future< int> - 删除数据
-
deleteMulti(
List< Object?> ? datas, [String? tableName]) → Future<int> - 删除多个Id
-
drop(
[String? tableName]) → Future< void> - 删除表所有数据
-
execute(
String sql, [List< Object?> ? arguments]) → Future<void> - 执行sql语句
-
fromJson(
Map json) → T -
inherited
-
insert(
T? t, [String? tableName]) → Future< int> - 插入单个model
-
insertAll(
List< T?> t, {String? tableName, String? nullColumnHack, ConflictAlgorithm? conflictAlgorithm = ConflictAlgorithm.replace}) → Future<int> - 插入所有model
-
insertMap(
Map< String, dynamic> t, [String? tableName]) → Future<int> - 插入map
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onUpgrade(
int oldVersion, int newVersion) → FutureOr< void> - 增加表更新的方法,这里只是回调到每个dao类中,一个dao类一个表,针对当前表进行更新
-
query(
{String? tableName, bool? distinct, List< String> ? columns, String? where, List<Object?> ? whereArgs, String? groupBy, String? having, String? orderBy, int? limit, int? offset}) → Future<List< T> > - 调用sqflite 封装好的查询
-
queryAll(
[String? tableName]) → Future< List< T> > - 查询该表的所有数据
-
queryCount(
[String? tableName]) → Future< int> - 查询该表的总数
-
queryMultiIds(
List< Object?> ? datas, [String? tableName]) → Future<List< T> > - 查询多个ids
-
queryOne(
Object arg, [String? tableName]) → Future< T?> - 根据id,查询一个
-
random(
[String? tableName]) → Future< T?> - 随机获取一个数据
-
randoms(
int count, [String? tableName]) → Future< List< T> > - 随机查询一组数据
-
rawQuery(
String sql, [List< Object?> ? arguments]) → Future<List< T> > - 调用sql语句执行
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
T? t, [String? tableName]) → Future< int> - 更新map
-
updateAll(
List< T> ? t, {String? tableName, ConflictAlgorithm? conflictAlgorithm = ConflictAlgorithm.replace}) → Future<int> - 更新所有数据库
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited