anchor.diff:    }
   
     @override
  -  Future<T> transaction<T>(FutureOr<T> Function() f) async {
  -    if (_connection is! PostgreSQLConnection) return await f();
  -    var old = _connection;
  +  Future<T> transaction<T>(FutureOr<T> Function(QueryExecutor) f) async {
  +    if (_connection is! PostgreSQLConnection) return await f(this);
       T result;
       try {
         logger?.fine('Entering transaction');
         await (_connection as PostgreSQLConnection).transaction((ctx) async {
  -        _connection = ctx;
  -        result = await f();
  +        var tx = PostgreSqlExecutor(ctx, logger: logger);
  +        result = await f(tx);
         });
       } finally {
  -      _connection = old;
         logger?.fine('Exiting transaction');
         return result;
       }
  
positive.code:   }
  
    @override
    Future<T> transaction<T>(FutureOr<T> Function() f) {
      return _pool.withResource(() async {
        var executor = await _next();
        return executor.transaction(f);
  
negative.code:   PostgreSQLExecutionContext get connection => _connection;
  
    /// Closes the connection.
    Future close() {
      if (_connection is PostgreSQLConnection) {
        return (_connection as PostgreSQLConnection).close();
      } else {
        return Future.value();
      }
    }
  
    @override
    Future<List<List>> query(
  