lithium\data\source\database\adapter\PostgreSql::_execute()

protected method

Execute a given query.

Parameters

  • string $sql

    The sql string to execute

  • array $options

    Available options:

Returns

\lithium\data\source\Result

Returns a result object if the query was successful.

Filter

This method can be filtered.

Source

	protected function _execute($sql, array $options = []) {
		$params = compact('sql', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			try {
				$resource = $this->connection->query($params['sql']);
			} catch (PDOException $e) {
				$this->_error($params['sql']);
			};
			return Libraries::instance(null, 'result', compact('resource'), $this->_classes);
		});
	}