findById method

  1. @override
Future<T?> findById({
  1. required String id,
  2. List<String>? fields,
  3. Database? database,
  4. List<ColumnRelation>? relations,
})
override

Implementation

@override
Future<T?> findById(
    {required String id,
    List<String>? fields,
    Database? database,
    List<ColumnRelation>? relations}) async {
  final Database db = database != null ? database : this.database;

  var results = await this.find(id: id, fields: fields, database: db);

  return results.length > 0 ? results[0] : null;
}