doDeleteSQL method

  1. @override
FutureOr<Iterable<Map<String, dynamic>>> doDeleteSQL(
  1. String entityName,
  2. String table,
  3. SQL sql,
  4. Transaction transaction,
  5. PostgreSQLConnectionWrapper connection,
)
override

Implementation

@override
FutureOr<Iterable<Map<String, dynamic>>> doDeleteSQL(
    String entityName,
    String table,
    SQL sql,
    Transaction transaction,
    PostgreSQLConnectionWrapper connection) {
  if (sql.isDummy) return <Map<String, dynamic>>[];

  return connection
      .mappedResultsQuery(sql.sql,
          substitutionValues: sql.parametersByPlaceholder)
      .resolveMapped((results) {
    var entries = results
        .map((e) => e[table])
        .whereType<Map<String, dynamic>>()
        .toList();

    return entries;
  });
}