@@ -50,6 +50,7 @@ def process_entities(entities):
50
50
@click .option ('--host' , '-h' , default = '127.0.0.1' , help = 'Redis server host' )
51
51
@click .option ('--port' , '-p' , default = 6379 , help = 'Redis server port' )
52
52
@click .option ('--password' , '-a' , default = None , help = 'Redis server password' )
53
+ @click .option ('--user' , '-w' , default = None , help = 'Username for Redis ACL' )
53
54
@click .option ('--unix-socket-path' , '-u' , default = None , help = 'Redis server unix socket path' )
54
55
# CSV file paths
55
56
@click .option ('--nodes' , '-n' , multiple = True , help = 'Path to node csv file' )
@@ -69,7 +70,7 @@ def process_entities(entities):
69
70
@click .option ('--max-token-size' , '-t' , default = 500 , help = 'max size of each token in megabytes (default 500, max 512)' )
70
71
@click .option ('--index' , '-i' , multiple = True , help = 'Label:Propery on which to create an index' )
71
72
@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 ):
73
74
if sys .version_info [0 ] < 3 :
74
75
raise Exception ("Python 3 is required for the RedisGraph bulk loader." )
75
76
@@ -87,9 +88,9 @@ def bulk_insert(graph, host, port, password, unix_socket_path, nodes, nodes_with
87
88
# Attempt to connect to Redis server
88
89
try :
89
90
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 )
91
92
else :
92
- client = redis .StrictRedis (host = host , port = port , password = password )
93
+ client = redis .StrictRedis (host = host , port = port , username = user , password = password )
93
94
except redis .exceptions .ConnectionError as e :
94
95
print ("Could not connect to Redis server." )
95
96
raise e
0 commit comments