queryOne method

  1. @override
Future<T?> queryOne(
  1. Object arg, [
  2. String? tableName
])
override

根据id,查询一个

Implementation

@override
Future<T?> queryOne(Object arg, [String? tableName]) async {
  List<T> items = await query(tableName: tableName, where: "$_primaryKey = ?", whereArgs: [arg]);
  return items.isNotEmpty ? items.first : null;
}