Executes the query

@return array the resultset
979951
protected function executeQuery(AnalyticsOverview $overview, $metrics)
    {
        $timestamps = $this->getTimestamps($overview);
        $extra = $this->getExtra($overview);

        // execute query
        $results = $this->query->getResultsByDate(
            $timestamps['begin'],
            $timestamps['end'],
            $metrics,
            $extra
        );

        return $results->getRows();
    }
586495
public function execute()
	{
		$query  = $this->factory->builder($this->insert)->process();
		$result = $this->pdo->query($query);
		if(!$result)
		{
			throw new \Exception('An error is while the insertion occurred! (query: "' . $query . '")');
		}

		return $this->pdo->lastInsertId();
	}
138665
public function execute()
    {
        try
        {
            $stmt = $this->prepare();
            if (LOG_DEBUG == Eresus_Kernel::$logLevel)
            {
                $insider = new DBQueryInsider;
                $this->doBind($insider);
                $s = $insider->subst($this);
                Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '("%s")', $s);
            }
            $stmt->execute();

        }
        catch (PDOException $e)
        {
            throw Eresus_DB_Exception_QueryFailed::create($this, $e);
        }

        return $stmt;
    }
293719
public function execute()
    {
        if($this->db === null) {
            $this->db = DB::getInstance();
        }
        return $this->db->execQuery($this);
    }
794891
protected function executeFilteredQuery()
    {
        $this->logQueryStart();
        $query = new WP_User_Query($this->filters);
        $this->logQueryCompletion($this->toSql($query));
        return $query->results;
    }
1216131
public function execute()
    {
        if ($this->type == self::SELECT) {
            $this->loaded = true;
            if ($this->cacheTime !== false) {
                return $this->fetchFromCache();
            } else {
                return $this->db->fetchAll($this->getSql(), $this->params, $this->paramTypes);
            }
        } else {
            return $this->db->executeUpdate($this->getSql(), $this->params, $this->paramTypes);
        }
    }
100548
public function runQuery()
    {
        $filters = $this->filters->get();
        $this->documents  = [];
        if (empty($filters))
            $filters = 'findAll';
        $this->documents = $this->databaseHandler->findAll()->getDocuments();
        if ($filters !== 'findAll')
            $this->filter($filters);
        $this->sort();
        $this->offsetLimit();
        if (is_array($this->fields) && !empty($this->fields))
        {
            foreach($this->documents as $index => $document)
            {
                $fields = new \stdClass();
                foreach($this->fields as $fieldTarget)
                    $fields->{$fieldTarget} = $document->{$fieldTarget};
                $this->documents[$index] = $fields;
            }
        }
        $this->databaseHandler->setDocuments($this->documents);
        return $this->databaseHandler;
    }
971772
protected function execute()
    {
        $connection = $this->collection->getConnection();

        $rows = $connection->getCollectionData($this->collection->getName(), $this->criteria);

        $this->rows = array_slice($rows, $this->skip, $this->limit);

        foreach ((array) $this->sorts as $field => $flag) {
            usort($this->rows, function($a, $b) use ($field, $flag) {
                if (isset($a[$field])) {
                    $aValue = utf8_encode(filter_var((string) $a[$field], FILTER_SANITIZE_STRING));
                    $bValue = utf8_encode(filter_var((string) $b[$field], FILTER_SANITIZE_STRING));

                    return strcasecmp($aValue, $bValue) * (int) $flag;
                }
            });
        }
    }
321251
public function execute()
    {
        $request       = $this->_request;
        $iTotalRecords = $this->_queryBuilder->getTotalRecords();
        list($data, $objects) = $this->_queryBuilder->getData();
        $id_index      = array_search('_identifier_', array_keys($this->getFields()));
        $ids           = array();
        array_walk($data, function($val, $key) use ($id_index, &$ids) {
            $ids[$key] = $val[$id_index];
        });
        if (!is_null($this->_fixed_data))
        {
            $this->_fixed_data = array_reverse($this->_fixed_data);
            foreach ($this->_fixed_data as $item)
            {
                array_unshift($data, $item);
            }
        }
        if (!is_null($this->_renderer))
        {
            array_walk($data, $this->_renderer);
        }
        if (!is_null($this->_renderer_obj))
        {
            $this->_renderer_obj->applyTo($data, $objects);
        }
        if (!empty($this->_multiple))
        {
            array_walk($data, function($val, $key) use(&$data, $ids) {
                array_unshift($val, "<input type='checkbox' name='dataTables[actions][]' value='{$ids[$key]}' />");
                $data[$key] = $val;
            });
        }
        $output = array(
            "sEcho"                => intval($request->get('sEcho')),
            "iTotalRecords"        => $iTotalRecords,
            "iTotalDisplayRecords" => $iTotalRecords,
            "aaData"               => $data
        );
        return new JsonResponse($output);
    }
986565
public function execute()
	{
		$pdoStatement = $this->pdo->prepare((string) $this);

		foreach ($this->bindings as $clause => $predicate) {
			foreach ($predicate as $key => $value) {
				$pdoStatement->bindValue(sprintf(':%s%d', $clause, $key + 1), $value, $this->getPdoDataType($value));
			}
		}

		$pdoStatement->execute();

		return new QueryResult($pdoStatement);
	}
1314778
public function executeQuery(): IResultSet {
        $temp = null;
        
        if (!$this->build()) {
            throw new \Exception('Error no se pudo construir la sentencia sql');
        }
        
        $temp = $this->conect->query($this->generate);
        $this->generate = "";
        
        if ($temp == null) {
            throw new \Exception('Error no se pudo encontrar nada en la base de datos');
        }
       
        return new ResultSetMYSQL($temp);
    }
933587
public function query()
    {
        $stmt = call_user_func_array([$this, 'executeSql'], func_get_args());
        if (ActiveRecord::lastError())
            return false;
        return $stmt->fetchAll();
    }
216706
public function execute()
    {
        $request = $this->initGraphqlRequest();
        $response = $request->postRaw(
            $this->buildPayload()
        );
        if ($response->getCode() !== 200) {
            throw ExceptionBuilder::fromHttpRequestAndResponse($request, $response);
        }

        return ResultSetBuilder::fromHttpResponse($response);
    }
300825
public function execute()
    {
        if (!is_string($this->_query)) {
            throw new ClientException('Query should be a string');
        }

        $data = $this->buildData();

        $tries = 0;
        while (true) {
            try {
                $response = $this->_connection->post(Urls::URL_CURSOR, $this->getConnection()->json_encode_wrapper($data), []);

                return new Cursor($this->_connection, $response->getJson(), $this->getCursorOptions());
            } catch (ServerException $e) {
                if ($tries++ >= $this->_retries) {
                    throw $e;
                }
                if ($e->getServerCode() !== 29) {
                    // 29 is "deadlock detected"
                    throw $e;
                }
                // try again
            }
        }
    }
636286
public function execute()
        {
            $values = ($this->getQuery() instanceof QueryInterface) ? $this->getQuery()->getValues() : array();
            if (Core::isDebugMode()) {
                if (Core::isDebugLoggingEnabled() && class_exists('\\caspar\\core\\Logging')) {
                    \caspar\core\Logging::log('executing PDO query (' . Core::getSQLCount() . ') - ' . (($this->getQuery() instanceof Criteria) ? $this->getQuery()->getAction() : 'unknown'), 'B2DB');
                }

                $previous_time = Core::getDebugTime();
            }

            $res = $this->statement->execute($values);

            if (!$res) {
                $error = $this->statement->errorInfo();
                if (Core::isDebugMode()) {
                    Core::sqlHit($this, $previous_time);
                }
                throw new Exception($error[2], $this->printSQL());
            }
            if (Core::isDebugLoggingEnabled() && class_exists('\\caspar\\core\\Logging')) {
                \caspar\core\Logging::log('done', 'B2DB');
            }

            if ($this->getQuery() instanceof Query && $this->getQuery()->isInsert()) {
                if (Core::getDriver() == Core::DRIVER_MYSQL) {
                    $this->insert_id = Core::getDBLink()->lastInsertId();
                } elseif (Core::getDriver() == Core::DRIVER_POSTGRES) {
                    $this->insert_id = Core::getDBLink()->lastInsertId(Core::getTablePrefix() . $this->getQuery()->getTable()->getB2DBName() . '_id_seq');
                    if (Core::isDebugLoggingEnabled() && class_exists('\\caspar\\core\\Logging')) {
                        \caspar\core\Logging::log('sequence: ' . Core::getTablePrefix() . $this->getQuery()->getTable()->getB2DBName() . '_id_seq', 'b2db');
                        \caspar\core\Logging::log('id is: ' . $this->insert_id, 'b2db');
                    }
                }
            }

            $return_value = new Resultset($this);

            if (Core::isDebugMode()) {
                Core::sqlHit($this, $previous_time);
            }

            if (!$this->getQuery() || $this->getQuery()->isSelect()) {
                $this->statement->closeCursor();
            }

            return $return_value;
        }
957716
protected function executeFilteredQuery()
    {
        $this->logQueryStart();
        $result = new WP_Query($this->getFilters());
        $this->logQueryCompletion($result->request);
        return $result;
    }
1028418
public function run()
	{
        // Grab a list of tables
		$this->printTaskInfo('Getting list of tables.');
		$html = $this->loggedIn->getClient()->get('db_structure.php',
		[
			'query' =>
			[
				'db' => $this->remoteDbName,
				'server' => $this->loggedIn->getServerId(),
				'token' => $this->loggedIn->getToken()
			]
		])->getBody();

        // Extract a list of tables from the html
        $regex = '/<a href="sql\.php\?db=.*?table=(.*?)&amp;pos=0" title="">.*?<\/a>/i';
		if (preg_match_all($regex, $html, $matches) !== false)
        {
            if (isset($matches[1]))
            {
                $this->tables = $matches[1];
            }
        }

        // If we get to here assume everything worked.
        // The tables can be accessed by calling getTask()->getTables().
		return Result::success($this);
    }