@@ -50,6 +50,7 @@ def process_entities(entities):
5050@click .option ('--host' , '-h' , default = '127.0.0.1' , help = 'Redis server host' )
5151@click .option ('--port' , '-p' , default = 6379 , help = 'Redis server port' )
5252@click .option ('--password' , '-a' , default = None , help = 'Redis server password' )
53+ @click .option ('--user' , '-w' , default = None , help = 'Username for Redis ACL' )
5354@click .option ('--unix-socket-path' , '-u' , default = None , help = 'Redis server unix socket path' )
5455# CSV file paths
5556@click .option ('--nodes' , '-n' , multiple = True , help = 'Path to node csv file' )
@@ -69,7 +70,7 @@ def process_entities(entities):
6970@click .option ('--max-token-size' , '-t' , default = 500 , help = 'max size of each token in megabytes (default 500, max 512)' )
7071@click .option ('--index' , '-i' , multiple = True , help = 'Label:Propery on which to create an index' )
7172@click .option ('--full-text-index' , '-f' , multiple = True , help = 'Label:Propery on which to create an full text search index' )
72- def bulk_insert (graph , host , port , password , unix_socket_path , nodes , nodes_with_label , relations , relations_with_type , separator , enforce_schema , skip_invalid_nodes , skip_invalid_edges , escapechar , quote , max_token_count , max_buffer_size , max_token_size , index , full_text_index ):
73+ def bulk_insert (graph , host , port , password , user , unix_socket_path , nodes , nodes_with_label , relations , relations_with_type , separator , enforce_schema , skip_invalid_nodes , skip_invalid_edges , escapechar , quote , max_token_count , max_buffer_size , max_token_size , index , full_text_index ):
7374 if sys .version_info [0 ] < 3 :
7475 raise Exception ("Python 3 is required for the RedisGraph bulk loader." )
7576
@@ -87,9 +88,9 @@ def bulk_insert(graph, host, port, password, unix_socket_path, nodes, nodes_with
8788 # Attempt to connect to Redis server
8889 try :
8990 if unix_socket_path is not None :
90- client = redis .StrictRedis (unix_socket_path = unix_socket_path , password = password )
91+ client = redis .StrictRedis (unix_socket_path = unix_socket_path , username = user , password = password )
9192 else :
92- client = redis .StrictRedis (host = host , port = port , password = password )
93+ client = redis .StrictRedis (host = host , port = port , username = user , password = password )
9394 except redis .exceptions .ConnectionError as e :
9495 print ("Could not connect to Redis server." )
9596 raise e
0 commit comments