getSomeColumnsFrom<T> method
Returns raw rows (as List<Map<String, Object?>>) for the columns
listDesColonne of the entity table T.
Example:
final rows = await DataAccess.instance
.getSomeColumnsFrom<Person>('firstName, lastName', afterWhere: 'id=1');
Throws DatabaseException if the entity table does not exist.
Implementation
Future<List<Map<String, Object?>>> getSomeColumnsFrom<T>(
String listDesColonne, {
String? afterWhere,
}) async {
final String whereClause =
afterWhere != null ? 'WHERE ${_sanitizeWhere(afterWhere)}' : '';
return (await db).transaction(
(txn) => txn.rawQuery(
'SELECT $listDesColonne FROM ${T.toString()} $whereClause',
),
);
}