getQueryObjectsList<T> method
Get a list of items defined by the queryObj
.
Optionally a custom whereString
piece can be passed in.
It can start with the keyword where.
Implementation
List<T> getQueryObjectsList<T>(QueryObjectBuilder<T> queryObj,
{String? whereString}) {
String querySql = "${queryObj.querySql()}";
if (whereString != null && whereString.isNotEmpty) {
if (whereString.trim().toLowerCase().startsWith("where")) {
querySql += whereString;
} else {
querySql += " where $whereString";
}
}
List<T> items = [];
var res = select(querySql);
res.forEach((QueryResultRow row) {
var obj = queryObj.fromRow(row);
items.add(obj);
});
return items;
}