Exemplo n.º 1
0
 def routing_info_procedure(self, routing_context):
     if ServerVersion.from_str(
             self._connection.server.version).at_least_version(3, 2):
         return self.call_get_routing_table, {
             self.get_routing_table_param: routing_context
         }
     else:
         return self.call_get_servers, {}
Exemplo n.º 2
0
 def __run__(self, _, routing_context):
     if ServerVersion.from_str(
             self._connection.server.version).at_least_version(
                 3, 2):
         statement, parameters = (
             "CALL dbms.cluster.routing.getRoutingTable({context})",
             {
                 "context": routing_context
             })
     else:
         statement, parameters = "CALL dbms.cluster.routing.getServers", {}
     return self._run(statement, parameters)
Exemplo n.º 3
0
 def server_version_info(cls):
     with GraphDatabase.driver(cls.bolt_uri, auth=cls.auth_token) as driver:
         with driver.session() as session:
             full_version = session.run("RETURN 1").summary().server.version
             return ServerVersion.from_str(full_version)