find method
Find row by primary key.
var userEloquent = UserEloquent();
// get user where primary key (id) is 1.
userEloquent.find(1);
Implementation
@override
Future<Map<String, Object?>?> find(primaryKeyValue) async {
Database _db = await getDatabase;
var results = await _db.query(
tableName,
columns: columns,
where: getPrimaryColumn + ' = ?',
whereArgs: [primaryKeyValue],
);
resetAll();
if (results.isNotEmpty) {
return results[0];
}
return null;
}