/**
  * @param QueryInterface $query
  *
  * @return Result|null
  * @throws Exception
  */
 public function process(QueryInterface $query)
 {
     if (!$query->isType(QueryInterface::TYPE_ALTER)) {
         return null;
     }
     return $this->getAlterChain()->getResult($query);
 }
 /**
  * @param QueryInterface $query
  *
  * @return Result|null
  * @throws Exception
  */
 public function process(QueryInterface $query)
 {
     if (!$query->isType(QueryInterface::TYPE_CREATE)) {
         return null;
     }
     return $this->getCreateChain()->getResult($query);
 }
 /**
  * QueryDecorator constructor.
  *
  * @param QueryInterface $decoratedQuery
  * @throws Exception
  */
 public function __construct(QueryInterface $decoratedQuery)
 {
     if (!$decoratedQuery->isType(static::TYPE)) {
         throw new Exception('Not a ' . static::TYPE . ' query.');
     }
     $this->decoratedQuery = $decoratedQuery;
 }
 /**
  * @param QueryInterface $query
  *
  * @return Result|null
  * @throws Exception
  */
 public function process(QueryInterface $query)
 {
     if (!$query->isType(QueryInterface::TYPE_SELECT)) {
         return null;
     }
     return $this->getSelectChain()->getResult($query);
 }
 /**
  * @param QueryInterface $query
  *
  * @return Result|null
  * @throws Exception
  */
 public function process(QueryInterface $query)
 {
     /* @var $query SelectQuery */
     if (!$query->isType(QueryInterface::TYPE_SELECT)) {
         return null;
     }
     $field = $query->getFirstField();
     if ($field->getType() !== Expression::TYPE_FUNCTION || $field->getExpression() !== Expression::EXPR_USER) {
         return null;
     }
     return $this->getResultFromData(self::$data, self::$fields);
 }
 /**
  * @param QueryInterface $query
  *
  * @return Result|null
  * @throws Exception
  */
 public function process(QueryInterface $query)
 {
     if (!$query->isType(QueryInterface::TYPE_USE)) {
         return null;
     }
     $query = new UseQuery($query);
     $keyspace = $query->getDbName();
     $this->dsn->getConfig()->setKeyspace($keyspace);
     if ($this->client instanceof CachingClient) {
         $this->client->clearCache();
     }
     return new EmptyResult();
 }