code: protected function getConnection()
      {
          $connection = $this->getClient()->getConnection();
  
          if ($connection instanceof ReplicationInterface) {
              $connection->switchToMaster();
          }
  
          return $connection;
      }
docs: Returns the underlying connection to be used by the pipeline.
  
  @return ConnectionInterface