doDeleteSQL method

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

Implementation

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

  var preSQLs = sql.preSQL;
  if (preSQLs != null) {
    for (var e in preSQLs) {
      _select(connection, e);
    }
  }

  ResultSet? results;
  if (!sql.isDummy) {
    results = _select(connection, sql);
  }

  var posSQLs = sql.posSQL;
  if (posSQLs != null) {
    var posResults = posSQLs.map((e) => _select(connection, e)).toList();

    var idx = sql.posSQLReturnIndex;
    if (idx != null) results = posResults[idx];
  }

  return _resultsToEntitiesMaps(results);
}