mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-28 09:56:22 +02:00
Feature/memgraph (#182)
* Add database override to bolt output, default is neo4j * Add memgraph templates
This commit is contained in:
parent
b2f7b34529
commit
9c97ca32f6
6 changed files with 171 additions and 5 deletions
|
|
@ -21,6 +21,7 @@ default_subscriber = module
|
|||
default_graph_host = 'bolt://neo4j:7687'
|
||||
default_username = 'neo4j'
|
||||
default_password = 'password'
|
||||
default_database = 'neo4j'
|
||||
|
||||
class Processor(ConsumerProducer):
|
||||
|
||||
|
|
@ -31,7 +32,8 @@ class Processor(ConsumerProducer):
|
|||
subscriber = params.get("subscriber", default_subscriber)
|
||||
graph_host = params.get("graph_host", default_graph_host)
|
||||
username = params.get("username", default_username)
|
||||
password = params.get("passowrd", default_password)
|
||||
password = params.get("password", default_password)
|
||||
database = params.get("database", default_database)
|
||||
|
||||
super(Processor, self).__init__(
|
||||
**params | {
|
||||
|
|
@ -44,7 +46,7 @@ class Processor(ConsumerProducer):
|
|||
}
|
||||
)
|
||||
|
||||
self.db = "neo4j"
|
||||
self.db = database
|
||||
|
||||
self.io = GraphDatabase.driver(graph_host, auth=(username, password))
|
||||
|
||||
|
|
@ -342,6 +344,12 @@ class Processor(ConsumerProducer):
|
|||
help=f'Neo4j password (default: {default_password})'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--database',
|
||||
default=default_database,
|
||||
help=f'Neo4j database (default: {default_database})'
|
||||
)
|
||||
|
||||
def run():
|
||||
|
||||
Processor.start(module, __doc__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue