diff options
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py index 160cfb6..ae4bbd3 100755 --- a/redis/client.py +++ b/redis/client.py @@ -439,7 +439,7 @@ class StrictRedis(object): string_keys_to_dict('ZSCORE ZINCRBY', float_or_none), string_keys_to_dict( 'FLUSHALL FLUSHDB LSET LTRIM MSET PFMERGE RENAME ' - 'SAVE SELECT SHUTDOWN SLAVEOF WATCH UNWATCH', + 'SAVE SELECT SHUTDOWN SLAVEOF SWAPDB WATCH UNWATCH', bool_ok ), string_keys_to_dict('BLPOP BRPOP', lambda r: r and tuple(r) or None), @@ -817,6 +817,10 @@ class StrictRedis(object): "Delete all keys in the current database" return self.execute_command('FLUSHDB') + def swapdb(self, first, second): + "Swap two databases" + return self.execute_command('SWAPDB', first, second) + def info(self, section=None): """ Returns a dictionary containing information about the Redis server |