diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-11-02 16:29:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-02 16:29:54 -0700 |
commit | 350362405112d6047ade4c3cc81931a2b4e33e36 (patch) | |
tree | ee2b39ccc8eb7dbe03128f018ae209a5af772a10 | |
parent | a0482156f4166cb7e44d14b57bdd18026acd3f15 (diff) | |
parent | 5f2333e0f2ea91e15a925fff1a772d95ca87411d (diff) | |
download | redis-py-350362405112d6047ade4c3cc81931a2b4e33e36.tar.gz |
Merge pull request #964 from remeika/documents-strictredis-rediss-support
Documents rediss:// support in StrictRedis.from_url
-rwxr-xr-x | redis/client.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/redis/client.py b/redis/client.py index 733a6bc..f4f7489 100755 --- a/redis/client.py +++ b/redis/client.py @@ -532,16 +532,24 @@ class StrictRedis(object): @classmethod def from_url(cls, url, db=None, **kwargs): """ - Return a Redis client object configured from the given URL, which must - use either `the ``redis://`` scheme - <https://www.iana.org/assignments/uri-schemes/prov/redis>`_ for RESP - connections or the ``unix://`` scheme for Unix domain sockets. + Return a Redis client object configured from the given URL For example:: redis://[:password]@localhost:6379/0 + rediss://[:password]@localhost:6379/0 unix://[:password]@/path/to/socket.sock?db=0 + Three URL schemes are supported: + + - ```redis://`` + <http://www.iana.org/assignments/uri-schemes/prov/redis>`_ creates a + normal TCP socket connection + - ```rediss://`` + <http://www.iana.org/assignments/uri-schemes/prov/rediss>`_ creates a + SSL wrapped TCP socket connection + - ``unix://`` creates a Unix Domain Socket connection + There are several ways to specify a database number. The parse function will return the first specified option: 1. A ``db`` querystring option, e.g. redis://localhost?db=0 |