all method
Return all rows from table.
var user = User();
var query = await user.cars();
//similar to userEloquent.get() but no matter what options you specify, they will be ignored and all rows will be returned.
await query.all();
//orderBy, limit will be ignored
await query.orderBy('name').limit(1).all();
Implementation
@override
Future<List<Map<String, Object?>>> all() async {
if (query == null) {
throw Exception('cannot query without relationship');
}
String q = 'SELECT table1.* from ' + query!;
try {
Database _db = await eloquent.getDatabase;
resetAll();
return await _db.rawQuery(q);
} catch (e) {
throw Exception('Generated query: "$q" \n' + e.toString());
}
}