anchor.diff:    ..addOption('concurrency',
         abbr: 'c', defaultsTo: '1', help: 'Number of concurrent processing.')
     ..addOption('package', abbr: 'p', help: 'The package to process.')
  +  ..addFlag('dry-run',
  +      abbr: 'n', help: 'Print changes but do not update entities.')
  +  ..addFlag('verbose', abbr: 'v', help: 'Print all changes.')
     ..addFlag('help', abbr: 'h', defaultsTo: false, help: 'Show help.');
  +
  +bool _isDryRun = false;
  +bool _isVerbose = false;
  +final _removedCount = <String, int>{};
   
   Future main(List<String> args) async {
     final argv = _argParser.parse(args);
  
positive.code:       await pool.close();
      }
    });
  }
  
  Future _processWithQuery<T extends ExpandoModel>(Query<T> query) async {
    await for (T m in query.run()) {
      if (m.additionalProperties.isNotEmpty) {
        await dbService.withTransaction((tx) async {
          final entry = (await tx.lookup<T>([m.key])).single;
          entry.additionalProperties.clear();
          tx.queueMutations(inserts: [entry]);
          await tx.commit();
        });
      }
    }
  }
  
  Future _processPackage(
    String package, {
    bool packageEntityNeedsUpdate = true,
  }) async {
    print('Processing package: $package');
    final pkgKey = dbService.emptyKey.append(Package, id: package);
  
    final versionQuery = dbService.query<PackageVersion>(ancestorKey: pkgKey);
    await _processWithQuery(versionQuery);
  
    final pubspecQuery = dbService.query<PackageVersionPubspec>()
      ..filter('package =', package);
    await _processWithQuery(pubspecQuery);
  
    final infoQuery = dbService.query<PackageVersionInfo>()
      ..filter('package =', package);
    await _processWithQuery(infoQuery);
  
    if (packageEntityNeedsUpdate) {
      await dbService.withTransaction((tx) async {
        final p = (await dbService.lookup<Package>([pkgKey])).single;
        if (p.additionalProperties.isEmpty) {
          await tx.rollback();
          return;
        }
        p.additionalProperties.clear();
        tx.queueMutations(inserts: [p]);
        await tx.commit();
      });
    }
  }
  
negative.code: // BSD-style license that can be found in the LICENSE file.
  
  import 'dart:async';
  import 'dart:convert';
  
  import 'package:args/args.dart';
  import 'package:gcloud/db.dart';
  