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
Support Database URLs #246
Comments
When 2.4 came out, we talked about doing this with the internal refactoring of how connections worked in redis-py. Ultimately, ended up punting on the idea for several reasons. Most notably, there's a number of options when creating a redis client instance that aren't able to be elegantly represented in a URL, e.g. ConnectionClass and unix_socket_path. However, I do see the value in what you're proposing, especially for services like Heroku/RedisToGo. Your suggestion of using a factory-like function might make a lot of my initial concern go away. |
I agree with your concern, which is why I think it should be a helper function instead of a first-class member of the API. So, you're 👍 to this? I can send a pull request if you'd like :) |
Send away! |
@andymccurdy excellent :) Do you think the function should exist at the root namespace (e.g. |
Root namespace. It's where you create a client instance the "normal way". |
Sent! 💨 |
We had the same problem for redis-rb, and avoided representing a remote as an URL for the same reasons. To still allow specifying the remote using an URL we take an |
A trend in platform as a service providers is to use Database URLs to supp. They're quickly becoming a standard.
SQLAlchemy and RedisToGo, for example, uses them for database connections.
I'd love to implement this at the redis-py level, if appropriate.
That would turn this code:
Into this:
The text was updated successfully, but these errors were encountered: