@@ -47,6 +47,7 @@ def process_entities(entities):
47
47
@click .option ('--host' , '-h' , default = '127.0.0.1' , help = 'Redis server host' )
48
48
@click .option ('--port' , '-p' , default = 6379 , help = 'Redis server port' )
49
49
@click .option ('--password' , '-a' , default = None , help = 'Redis server password' )
50
+ @click .option ('--unix-socket-path' , '-u' , default = None , help = 'Redis server unix socket path' )
50
51
# CSV file paths
51
52
@click .option ('--nodes' , '-n' , multiple = True , help = 'Path to node csv file' )
52
53
@click .option ('--nodes-with-label' , '-N' , nargs = 2 , multiple = True , help = 'Label string followed by path to node csv file' )
@@ -64,7 +65,7 @@ def process_entities(entities):
64
65
@click .option ('--max-token-size' , '-t' , default = 500 , help = 'max size of each token in megabytes (default 500, max 512)' )
65
66
@click .option ('--index' , '-i' , multiple = True , help = 'Label:Propery on which to create an index' )
66
67
@click .option ('--full-text-index' , '-f' , multiple = True , help = 'Label:Propery on which to create an full text search index' )
67
- def bulk_insert (graph , host , port , password , nodes , nodes_with_label , relations , relations_with_type , separator , enforce_schema , skip_invalid_nodes , skip_invalid_edges , quote , max_token_count , max_buffer_size , max_token_size , index , full_text_index ):
68
+ 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 , quote , max_token_count , max_buffer_size , max_token_size , index , full_text_index ):
68
69
if sys .version_info [0 ] < 3 :
69
70
raise Exception ("Python 3 is required for the RedisGraph bulk loader." )
70
71
@@ -81,7 +82,10 @@ def bulk_insert(graph, host, port, password, nodes, nodes_with_label, relations,
81
82
82
83
# Attempt to connect to Redis server
83
84
try :
84
- client = redis .StrictRedis (host = host , port = port , password = password )
85
+ if unix_socket_path is not None :
86
+ client = redis .StrictRedis (unix_socket_path = unix_socket_path , password = password )
87
+ else :
88
+ client = redis .StrictRedis (host = host , port = port , password = password )
85
89
except redis .exceptions .ConnectionError as e :
86
90
print ("Could not connect to Redis server." )
87
91
raise e
0 commit comments