Wraps a RiakCursor instance with a LoggableCursor.

@see Collection::wrapCursor()
@param \RiakCursor $cursor
@param array        $query
@param array        $fields
@return LoggableCursor
972446
protected function wrapCursor(\RiakCursor $cursor, $query, $fields)
    {
        return new LoggableCursor($this, $cursor, $query, $fields, $this->numRetries, $this->loggerCallable);
    }
400431
public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*'])
    {
        if ($query->getQuery()->from == $parentQuery->getQuery()->from) {
            return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns);
        }

        return parent::getRelationExistenceQuery($query, $parentQuery, $columns);
    }
977969
protected function doFind(array $query, array $fields)
    {
        $mongoCollection = $this->mongoCollection;
        $cursor = $this->retry(function() use ($mongoCollection, $query, $fields) {
            return $mongoCollection->find($query, $fields);
        });
        return $this->wrapCursor($cursor, $query, $fields);
    }
840113
public function execute($query)
    {
        $this->db->setQuery($query)->execute();

        $this->cursor = $this->db->getCursor();

        return $this;
    }
831223
public static function plainSql($query)
    {
        $query = static::getBaseQuery($query);
        return self::inlineBindings($query->toSql(), $query->getBindings());
    }
789107
public function select($fields = '*')
    {
        $query = new Query\SelectQuery();

        if ($this->pdo) {
            $query->setPDO($this->pdo);
        }

        return $query->select($fields);
    }
805521
public function get_cursor($collection = "")
	{
		if (empty($collection))
		{
			throw new \Mongo_DbException("In order to retrieve documents from MongoDB you must provide a collection name.");
		}

		$documents = $this->db->{$collection}->find($this->wheres, $this->selects)->limit((int) $this->limit)->skip((int) $this->offset)->sort($this->sorts);

		$this->_clear();

		return $documents;
	}
568268
public function query($query)
    {
        $this->errorInfo = null;
        $this->errorCode = null;
        $query = trim(strtolower($query));
        if ($query === 'show tables') {
            $data = array();
            foreach ($this->tables as $k => $table) {
                $data[] = array('name' => $k);
            }
            return new Cursor($data);
        }
        $this->errorInfo = 'Invalid query';
        $this->errorCode = self::ERROR_QUERY;
    }
1313938
private function wrapCursor(Cursor $baseCursor) : Iterator
    {
        return new CachingIterator(new HydratingIterator($baseCursor, $this->dm->getUnitOfWork(), $this->class));
    }
1249978
protected function doFindOne(array $query, array $fields)
    {
        $mongoCollection = $this->mongoCollection;
        return $this->retry(function() use ($mongoCollection, $query, $fields) {
            return $mongoCollection->findOne($query, $fields);
        });
    }
1096855
public function find($condition = [], $fields = [], $options = [])
    {
        return new Cursor($this, parent::find($condition, $fields, $options));
    }
990718
public static function query($query)
    {
        $res = self::connection()->sql_query($query);

        if (!$res || self::connection()->sql_errno()) {
            // SQL statement failed
            $errorMsg = sprintf(
                'SQL Error: %s [errno: %s]',
                self::connection()->sql_error(),
                self::connection()->sql_errno()
            );

            if (defined('TYPO3_cliMode')) {
                throw new \Exception($errorMsg);
            } else {
                debug('SQL-QUERY: ' . $query, $errorMsg, __LINE__, __FILE__);
            }

            $res = null;
        }

        return $res;
    }
1205010
final public function queryArrayOne(string $query, string $field = '')
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        $verifiedFieldName = false;
        while ($row = $result->fetchRow()) {
            if ('' === $field) {
                $keys = array_keys($row);
                $field = $keys[0];
                $verifiedFieldName = true;
            }
            if (! $verifiedFieldName) {
                if (! array_key_exists($field, $row)) {
                    return false;
                }
                $verifiedFieldName = true;
            }
            $return[] = $row[$field] ?? null;
        }
        return $return;
    }
479194
public function cursor(
        $start = '*',
        $rows = 100,
        $options = []
    ) {
        $defaultOptions = [
            'sort' => 'id desc',
            'fl' => '*',
            'q' => '*',
            'rows' => 100
        ];

        $params = array_merge(
            $defaultOptions,
            $options,
            [
                'cursorMark' => $start,
                'rows' => $rows
            ]
        );

        $result = $this->search($params);

        return $result;
    }
165180
public function find($query, $sort = array(), $skip = 0, $limit = 0, $fields = array())
    {
        $cursor = $this->collection->find($query, $fields);
        $count = $cursor->count();
        if (empty($count)) {
            return array();
        }
        if ($sort) $cursor->sort($sort);
        if ($skip) $cursor->skip($skip);
        if ($limit) $cursor->limit($limit);
        return iterator_to_array($cursor);
    }
616468
private function addParamsToQuery(\stdClass $obj_query, array $arr_params)
    {
        if(count($arr_params) > 0) {
            $obj_bindings = new \stdClass();
            foreach ($arr_params as $str_name => $mix_value) {
                if('startCursor' == $str_name || 'endCursor' == $str_name) {
                    $obj_bindings->{$str_name} = (object)['cursor' => (string)$mix_value];
                } else {
                    $obj_bindings->{$str_name} = (object)['value' => $this->buildQueryParamValue($mix_value)];
                }
            }
            $obj_query->namedBindings = $obj_bindings;
        }
    }
1256290
public function visit($query, $node, string $context)
    {
        if ($node instanceof $this->node) {
            $bindings = [];
            $sql = [];

            $child0 = $node->getChildByIndex(0);
            $child1 = $node->getChildByIndex(1);

            if ($child0 instanceof Nodes\KeyNode) {
                $context === Nodes\OrNode::class && $query->orWhereNotNull($this->parseKey($child0->getValue()));
                $context === Nodes\AndNode::class && $query->whereNotNull($this->parseKey($child0->getValue()));
            }
        }
    }