Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Falkordb Bulk Insert does not support --unix-socket-path option. #11

Open
sachinjogi opened this issue Sep 11, 2024 · 2 comments · May be fixed by FalkorDB/falkordb-py#66
Open

Falkordb Bulk Insert does not support --unix-socket-path option. #11

sachinjogi opened this issue Sep 11, 2024 · 2 comments · May be fixed by FalkorDB/falkordb-py#66

Comments

@sachinjogi
Copy link

sachinjogi commented Sep 11, 2024

I'm trying to port my app from redisgraph to falkordb.

My redis instance listens on unix socket instead of tcp. I want to know how I can use falkordb-bulk-insert if my redis is listening on Unix socket.

I'm currently using redisgraph-bulk-insert v0.10.2. Noting that --unix-socket-path was deprecated in redisgraph-bulk-loader v0.12.0.

Since falkordb-bulk-insert uses server_url, which internally uses the from_url in redis python, I tried using falkordb-bulk-insert --server-url "unix:///sockets/redis0.sock", but I run into the below error.

redis.exceptions.ConnectionError: Error 97 connecting to localhost:6379. Address family not supported by protocol.

I did try to connect to the redis directly using redis-python using the above unix socket url and appears to be working.

In [3]: redis.from_url("unix:///sockets/redis0.sock").ping()
Out[3]: True

Any idea what might be wrong?

This is same requirement as RedisGraph#109.

@sachinjogi
Copy link
Author

I think, this change would be good enough.

bash-4.4# git diff
diff --git a/falkordb/falkordb.py b/falkordb/falkordb.py
index 9d3df80..7f468e7 100644
--- a/falkordb/falkordb.py
+++ b/falkordb/falkordb.py
@@ -141,6 +141,7 @@ class FalkorDB():
         kwargs['port'] = connection_kwargs.get('port', 6379)
         kwargs['username'] = connection_kwargs.get('username')
         kwargs['password'] = connection_kwargs.get('password')
+        kwargs['unix_socket_path'] = connection_kwargs.get('path')

         # Initialize a FalkorDB instance using the updated kwargs
         db = cls(**kwargs)

sachinjogi added a commit to sachinjogi/falkordb-py that referenced this issue Sep 23, 2024
@sachinjogi
Copy link
Author

I've raised a PR to fix this in falkordb-py FalkorDB/falkordb-py@main...sachinjogi:falkordb-py:patch-1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant