diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2011-05-24 09:08:09 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2011-05-24 09:08:09 -0700 |
commit | e2b6a8068bef111f13834ee298d7d931a1070773 (patch) | |
tree | 388172416e53573776e26b472e0eb0c7f9380052 | |
parent | 1c3546c27b8be7e179ce973952ac70861c4861db (diff) | |
download | redis-py-e2b6a8068bef111f13834ee298d7d931a1070773.tar.gz |
remove the SELECT command completely. use a separate client instance instead.
-rw-r--r-- | CHANGES | 12 | ||||
-rw-r--r-- | redis/client.py | 10 |
2 files changed, 5 insertions, 17 deletions
@@ -24,13 +24,11 @@ belong to and return a connection to it. ConnectionPool also implements disconnect() to force all connections in the pool to disconnect from the Redis server. - * redis-py does not treat the SELECT command as special anymore. Previously, - redis-py tried to make sure you didn't shoot yourself in the foot by - SELECTing a different database, then reusing that connection later and - expecting it to be set. In practice, this caused more headaches than it - was worth. So you can use SELECT if you really want to, although it's - highly recommended to instead create a separate client instance and - connection pool for each Redis database you want to talk to. + * redis-py no longer support the SELECT command. You can still connect to + a specific database by specifing it when instantiating a client instance + or by creating a connection pool. If you need to talk to multiplate + databases within your application, you should use a separate client + instance for each database you want to talk to. * Completely refactored Publish/Subscribe support. The subscribe and listen commands are no longer available on the redis-py Client class. Instead, the `pubsub` method returns an instance of the PubSub class which contains diff --git a/redis/client.py b/redis/client.py index aafdd17..a87e082 100644 --- a/redis/client.py +++ b/redis/client.py @@ -294,16 +294,6 @@ class Redis(object): """ return self.execute_command('SAVE') - def select(self, db): - """ - Select a differnet Redis database. - - WARNING: this could have severe consequences for pooled connections. - It's highly advised to use a separate connection pool and client - instance to work with multiple databases. Use this at your own risk. - """ - return self.execute_command('SELECT', db) - def shutdown(self): "Shutdown the server" try: |