예제 #1
0
    def _run(self, statement, parameters):
        if self.closed():
            raise SessionError("Session closed")

        run_response = Response(self._connection)
        pull_all_response = Response(self._connection)
        self._last_result = result = BoltStatementResult(self, run_response, pull_all_response)
        result.statement = ustr(statement)
        result.parameters = _fix_parameters(parameters, self._connection.protocol_version,
                                            supports_bytes=self._connection.server.supports_bytes())

        self._connection.append(RUN, (result.statement, result.parameters), response=run_response)
        self._connection.append(PULL_ALL, response=pull_all_response)

        return result
예제 #2
0
    def _run(self, statement, parameters):
        if self.closed():
            raise SessionError("Session closed")

        run_response = Response(self._connection)
        pull_all_response = Response(self._connection)
        self._last_result = result = BoltStatementResult(self, run_response, pull_all_response)
        result.statement = ustr(statement)
        result.parameters = _fix_parameters(parameters, self._connection.protocol_version)

        try:
            self._connection.append(RUN, (result.statement, result.parameters), response=run_response)
            self._connection.append(PULL_ALL, response=pull_all_response)
        except AttributeError:
            pass

        return result
예제 #3
0
    def _run(self, statement, parameters):
        assert isinstance(statement, unicode)
        assert isinstance(parameters, dict)

        if self.closed():
            raise SessionError("Session closed")

        run_response = Response(self._connection)
        pull_all_response = Response(self._connection)
        self._last_result = result = BoltStatementResult(
            self, run_response, pull_all_response)
        result.statement = statement
        result.parameters = parameters

        try:
            self._connection.append(RUN, (statement, parameters),
                                    response=run_response)
            self._connection.append(PULL_ALL, response=pull_all_response)
        except AttributeError:
            pass

        return result