doCountSQL method
FutureOr<int>
doCountSQL(
- String entityName,
- String table,
- SQL sql,
- Transaction transaction,
- DBMySqlConnectionWrapper connection,
override
Implementation
@override
FutureOr<int> doCountSQL(String entityName, String table, SQL sql,
Transaction transaction, DBMySqlConnectionWrapper connection) {
return connection
.query(sql.sqlPositional, sql.parametersValuesByPosition)
.resolveMapped((results) {
var count = results.map((r) => r.values?.first).firstOrNull ?? 0;
return count is int ? count : int.tryParse(count.toString().trim()) ?? 0;
});
}