diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-21 10:28:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:16:53 +0000 |
commit | 06cba6ccd165ca8b224797e37fccb9e63f026d77 (patch) | |
tree | e82f1bc439997ae296f2e74f8a64d84c5d95f140 /iredis/data/commands/select.md | |
parent | Initial commit. (diff) | |
download | iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.tar.xz iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.zip |
Adding upstream version 1.9.1.upstream/1.9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/select.md')
-rw-r--r-- | iredis/data/commands/select.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/iredis/data/commands/select.md b/iredis/data/commands/select.md new file mode 100644 index 0000000..ff366c6 --- /dev/null +++ b/iredis/data/commands/select.md @@ -0,0 +1,27 @@ +Select the Redis logical database having the specified zero-based numeric index. +New connections always use the database 0. + +Selectable Redis databases are a form of namespacing: all databases are still +persisted in the same RDB / AOF file. However different databases can have keys +with the same name, and commands like `FLUSHDB`, `SWAPDB` or `RANDOMKEY` work on +specific databases. + +In practical terms, Redis databases should be used to separate different keys +belonging to the same application (if needed), and not to use a single Redis +instance for multiple unrelated applications. + +When using Redis Cluster, the `SELECT` command cannot be used, since Redis +Cluster only supports database zero. In the case of a Redis Cluster, having +multiple databases would be useless and an unnecessary source of complexity. +Commands operating atomically on a single database would not be possible with +the Redis Cluster design and goals. + +Since the currently selected database is a property of the connection, clients +should track the currently selected database and re-select it on reconnection. +While there is no command in order to query the selected database in the current +connection, the `CLIENT LIST` output shows, for each client, the currently +selected database. + +@return + +@simple-string-reply |