doExistIDsSQL<I extends Object> method

  1. @override
FutureOr<List<I>> doExistIDsSQL<I extends Object>(
  1. String entityName,
  2. String table,
  3. SQL sql,
  4. Transaction transaction,
  5. DBMySqlConnectionWrapper connection,
)
override

Implementation

@override
FutureOr<List<I>> doExistIDsSQL<I extends Object>(
    String entityName,
    String table,
    SQL sql,
    Transaction transaction,
    DBMySqlConnectionWrapper connection) {
  if (sql.isDummy) return <I>[];

  return connection
      .query(sql.sqlPositional, sql.parametersValuesByPosition)
      .resolveMapped((results) {
    var ids = results
        .map((e) => e.fields)
        .whereType<Map<String, dynamic>>()
        .map((e) => e['id']);

    return parseIDs<I>(ids);
  });
}