applyTransactionUpdateAndCollectKeys method

Set applyTransactionUpdateAndCollectKeys(
  1. BsatnRowList deletes,
  2. BsatnRowList inserts,
  3. EventContext context, {
  4. Set? protectedKeys,
  5. bool reconcile = false,
})

Apply transaction update and return the set of touched primary keys

Used for touch-based optimistic confirmation. Returns all primary keys that were inserted, updated, or deleted in this transaction.

Implementation

Set<dynamic> applyTransactionUpdateAndCollectKeys(
  BsatnRowList deletes,
  BsatnRowList inserts,
  EventContext context, {
  Set<dynamic>? protectedKeys,
  bool reconcile = false,
}) {
  final changes = _applyChanges(
    deletes,
    inserts,
    protectedKeys: protectedKeys,
    reconcile: reconcile,
  );
  _emitChanges(changes, context);

  if (isEvent) {
    _rowsByPrimaryKey.clear();
    _rows.clear();
  }

  return changes.touchedKeys;
}