public function execute($sql, $executor)
    {
        foreach($this->_onquery as $callback)
            $sql = call_user_func($callback, $sql);

        try {
            $ts = count($this->_onresult) ? microtime(true) : NULL;
            $result = call_user_func($executor, $sql);

            foreach($this->_onresult as $callback)
                $result = call_user_func($callback, $sql, $result, $ts);

            return $result;
        } catch (\Exception $e) {
            foreach($this->_onerror as $callback)
                call_user_func($callback, $e);

            throw $e;
        }
    }