convert Query Param to mysql query string
@param QueryCriterionInterface $query
@return string
348028
public function convert(QueryCriterionInterface $query) {
        $value = '%' . $query->getValue();
        $value = $this->getDriverEscaper()->escape($value);
        $value = $this->getDriverEscaper()->quote($value);
        return '' .$this->setPropertyName($query->getName()) . ' ' . $this->getDriverEscaper()->reserved('object') . ' ' . $this->getOperator() . ' ' . $value . '';
    }
569319
public function getResult(QueryInterface $query)
    {
        $vtCtldResult = $this->client->getVSchema();
        $cursor = new Cursor($vtCtldResult->getData(), $vtCtldResult->getFields());

        return new Result($cursor);
    }
1277557
public function apply(Query $query) : Query
    {
        $method = is_array($this->value) ? 'in' : 'eq';

        return $query->where(
            (new QueryExpression())->{$method}(
                $this->field,
                [] === $this->value ? '' : $this->value,
                $query->getTypeMap()->type($this->field)
            )
        );
    }
668419
public function sql($query, $args = []) {
		if (!is_string($query) || empty($query))
			throw new \InvalidArgumentException("Query is not a valid string");
	
		//open connection
		$this->driver->connect();
			
		//build statement
		$stmt = $this->driver->buildStatement($this->typeManager);
	
		//build query
		$query = $stmt->format($query, $args, $this->config);
		
		//invoke debug callback
		if ($this->hasOption('callback.debug')) {
			$callback = $this->getOption('callback.debug');
			if ($callback instanceof \Closure)
				$callback->__invoke($query);
		}
		
		//run query
		$result = $this->driver->query($query);
	
		//check query execution
		if ($result === false)
			$this->driver->throwQueryException($stmt);
	
		return $result;
	}
575245
public function apply(QueryObjectInterface $query)
    {
        if (empty($this->fields)) {
            return $this;
        }
        
        $query->where(
            [
                $this->getQueryCondition() => [
                    ':pattern' => "%{$this->pattern}%"
                ]
            ]
        );
        return $this;
    }
1164199
protected function getQueryString($query)
    {
        $wrapper = ($query instanceof AbstractQuery) ? array('query' => $query->toArray()) : $query->toArray();

        return json_encode($wrapper);
    }
974813
public function withQuery($query)
    {
        if (!is_string($query) && !method_exists($query, '__toString')) {
            throw new \InvalidArgumentException('Query string must be a string');
        }
        $query = (string) $query;
        if (strpos($query, '?') === 0) {
            $query = substr($query, 1);
        }
        $query = $this->filterQueryAndFragment($query);

        $new = clone $this;
        $new->query = $query;

        return $new;
    }
4452
public function process(QueryInterface $query)
    {
        if (!$query instanceof ShowQuery || $query->getObject() !== ShowQuery::EXPRESSION_CREATE_TABLE) {
            return null;
        }

        $table = $query->getCreateObjectExpression(ShowQuery::EXPRESSION_CREATE_TABLE);

        if (!$table) {
            throw new Exception('Table missing.');
        }

        $tablet = $this->tablet->getTablet();
        $schemaCmd = new GetSchema($tablet->getAlias());
        /* @var $result GetSchemaResult */
        $result = $this->client->executeCommand($schemaCmd);

        return new CreateTable($result, $table);
    }
380455
protected function query(QueryInterface $query)
    {
        $metadata = $this->getClassMetadata();

        foreach ($metadata->getFieldMappings() as $field) {
            $fieldtype = $this->getFieldManager()->get($field['fieldtype'], $field);
            if ($fieldtype instanceof FieldTypeInterface) {
                $fieldtype->query($query, $metadata);
            }
        }
    }
932111
private function parseQuery($query)
	{
		$string = '';
		if (is_array($query))
		{
			foreach ($query as $index => $value)
			{
				$string .= !empty($string) ? ' AND ' : '';
				$string .= $index . ':' . $value;
			}
		}
		else
		{
			$string = 'id:' . $query;
		}
		return $string;
	}
717916
private static function getCanonicalQuery($query = '')
    {

        if (empty($query)) {
            return $query;
        }

        $queryArray = self::encodeQueryParts($query);

        ksort($queryArray);

        $query = self::buildQuery($queryArray);

        return $query;
    }
895092
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();
    }
295061
protected function convertQuery($query)
    {
        if (is_array($query)) {
            return array_map(function ($value) {
                if ($value instanceof Model) {
                    return $value->pk;
                } elseif ($value instanceof Manager || $value instanceof QuerySet) {
                    return $value->getQueryBuilder();
                }

                return $value;
            }, $query);
        } else {
            return $query;
        }
    }
19893
public function buildSqlQuery(IndexQueryInterface $query, array $columns = null)
    {
        $queryString = sprintf("SELECT `%s` FROM `%s`", implode("`,`", $columns), $query->getName());

        if ("" !== $criteria = $this->buildSqlConditions($query)) {
            $queryString .= sprintf(" WHERE %s", $criteria);
        }

        if (null !== $limit = $query->getLimit()) {
            $queryString .= sprintf(" LIMIT %d", $limit);
        }

        return $queryString;
    }
1374089
public function query(QueryInterface $query, $return = false)
    {
        DebuggerUtility::var_dump(
            $this->queryParser->parseQuery($query),
            null,
            8,
            false,
            true,
            $return
        );
    }
1362683
public function load(Queries\Interfaces\SearchQueryInterface $query): ServiceInterface
    {
        $this->query = $query;

        $parameters = [
            static::INPUT => trim($this->query->getInput()),
            static::SESSION_TOKEN => $this->query->getToken(),
            static::LANGUAGE => $this->query->getLanguage()->getValue(),
            static::COMPONENTS => static::COUNTRY . mb_strtolower($this->config->getCountry()),
            static::KEY => $this->config->getKey(),
        ];

        if ($this->query instanceof Queries\Interfaces\CitySearchInterface) {
            $parameters[static::TYPE] = static::CITIES;
        } elseif ($this->query instanceof Queries\Interfaces\StreetSearchInterface) {
            $parameters[static::INPUT] = trim($this->query->getType()) . ' ' . $parameters[static::INPUT];
            $parameters[static::TYPE] = static::ADDRESS;
        } else {
            throw new Exceptions\InvalidQueryType($this->query);
        }

        $response = $this->client->request('GET', $this->config->getUrl(), [
            GuzzleHttp\RequestOptions::QUERY => $parameters,
        ]);

        $responseBody = $response->getBody();
        $data = json_decode($responseBody, true);

        if (json_last_error() !== JSON_ERROR_NONE || !array_key_exists(static::STATUS, $data)) {
            throw new Exceptions\InvalidResponse($response);
        }

        $status = new Enums\SearchStatus($data[static::STATUS]);

        $this->validateStatus($status);

        if ($this->existPredictionWrapper($data)) {
            $this->locations = $this->fetchResults($data[static::PREDICTION_COLLECTION]);
        }

        return $this;
    }
105659
public function execute( $query ) {
		if ( $query instanceof QueryBuilder ) {
			$query = $query->getSPARQL();
		}

		if ( !is_string( $query ) ) {
			throw new InvalidArgumentException( '$query has to be a string or an instance of QueryBuilder' );
		}

		$result = $this->getResult( $query );
		
		// TODO also support ask queries (with key 'boolean')
		//      https://www.w3.org/TR/rdf-sparql-json-res/
		return $result['results'];
	}