rawQuery method

  1. @override
Future<List<T>> rawQuery(
  1. String sql, [
  2. List<Object?>? arguments
])
override

调用sql语句执行

Implementation

@override
Future<List<T>> rawQuery(String sql, [List<Object?>? arguments]) async {
  List<Map<String, Object?>> lists = await db.rawQuery(sql, arguments);
  if (lists.isEmpty) return [];
  List<T> datas = [];
  for (Map<String, Object?> map in lists) {
    datas.add(fromJson(map));
  }
  return datas;
}