final public function plainQuery($query, $fetch = null)
    {
        $this->forcedConnect();
        $implementation = $this->connector->getImplementation();
        $connection = $this->connector->getConnection();
        $duration = microtime(true);
        $cursor = $implementation->query($connection, $query);
        $duration = microtime(true) - $duration;
        if (!$cursor) {
            $errorInfo = $implementation->getErrorInfo($connection);
            $errorCode = $implementation->getErrorCode($connection);
            throw new Query($query, $errorInfo, $errorCode);
        }
        $this->debugLog($query, $duration, null);
        $fetcher = $this->createFetcher($cursor);
        if ($fetch === null) {
            return $fetcher;
        }
        return $fetcher->fetch($fetch);
    }
final public function plainQuery($query, $fetch = null)
    {
        $this->forcedConnect();
        $implementation = $this->connector->getImplementation();
        $connection = $this->connector->getConnection();
        $duration = microtime(true);
        $cursor = $implementation->query($connection, $query);
        $duration = microtime(true) - $duration;
        if (!$cursor) {
            $errorInfo = $implementation->getErrorInfo($connection);
            $errorCode = $implementation->getErrorCode($connection);
            throw new Query($query, $errorInfo, $errorCode);
        }
        $this->debugLog($query, $duration, null);
        $fetcher = $this->createFetcher($cursor);
        if ($fetch === null) {
            return $fetcher;
        }
        return $fetcher->fetch($fetch);
    }
final public function plainQuery ( $ query , $ fetch = null ) { $ this -> forcedConnect ( ) ; $ implementation = $ this -> connector -> getImplementation ( ) ; $ connection = $ this -> connector -> getConnection ( ) ; $ duration = microtime ( true ) ; $ cursor = $ implementation -> query ( $ connection , $ query ) ; $ duration = microtime ( true ) - $ duration ; if ( ! $ cursor ) { $ errorInfo = $ implementation -> getErrorInfo ( $ connection ) ; $ errorCode = $ implementation -> getErrorCode ( $ connection ) ; throw new Query ( $ query , $ errorInfo , $ errorCode ) ; } $ this -> debugLog ( $ query , $ duration , null ) ; $ fetcher = $ this -> createFetcher ( $ cursor ) ; if ( $ fetch === null ) { return $ fetcher ; } return $ fetcher -> fetch ( $ fetch ) ; }
Performs a "plain" query

@param string $query
a plain query
@param string $fetch [optional]
the result format
@return \go\DB\Result
the query result in specified format
@throws \go\DB\Exceptions\Connect
an error of lazy connection
@throws \go\DB\Exceptions\Closed
the connection is closed
@throws \go\DB\Exceptions\Query
an error of the query
@throws \go\DB\Exceptions\Fetch
the result format is invalid for this query type
Performs a plain query