Skip to content

Commit

Permalink
adds scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Oct 10, 2023
1 parent 869a5a7 commit 92675c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ceurws/volume_neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Neo4j:
"""
Neo4j wrapper class
"""
def __init__(self,host:str="localhost",bolt_port:int=7687,auth=("neo4j", "password"),encrypted:bool=False):
def __init__(self,host:str="localhost",bolt_port:int=7687,auth=("neo4j", "password"),scheme:str="bolt",encrypted:bool=False):
"""
constructor
"""
Expand All @@ -25,8 +25,9 @@ def __init__(self,host:str="localhost",bolt_port:int=7687,auth=("neo4j", "passwo
self.host=host
self.bolt_port=bolt_port
self.encrypted=encrypted
self.scheme=scheme
try:
uri=f"bolt://{host}:{bolt_port}"
uri=f"{scheme}://{host}:{bolt_port}"
if not Neo4j.is_port_available(host,bolt_port):
raise ValueError(f"port at {uri} not available")
self.driver = GraphDatabase.driver(uri, auth=auth,encrypted=encrypted)
Expand Down

0 comments on commit 92675c3

Please sign in to comment.