Skip to content
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

Allowing selecting Redis database #62

Open
rpj opened this issue Apr 12, 2023 Discussed in #61 · 4 comments
Open

Allowing selecting Redis database #62

rpj opened this issue Apr 12, 2023 Discussed in #61 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rpj
Copy link
Member

rpj commented Apr 12, 2023

Need to add the ability to chose a Redis database number.

Simplest implementation would be to just add a SELECT command implementation that the consumer must call explicitly.

Slightly better UX would be to add an option, defaulted to 0, to the Redis constructor.

Discussed in #61

Originally posted by MichKonSher April 12, 2023
Hello!
Is it possible to select db on Redis intance, such as db0, db1. e.t.c.?
I didn't find possibility to do this or to execute custom command.

@rpj rpj added enhancement New feature or request good first issue Good for newcomers labels Apr 12, 2023
@MichKonSher
Copy link

MichKonSher commented Apr 13, 2023

Slightly better UX would be to add an option, defaulted to 0, to the Redis constructor.

I think it shouldn't be the only one way to set DB number.
I have possible situations when one Redis object using to interact with different DB numbers.

@rpj
Copy link
Member Author

rpj commented Apr 13, 2023

I think it shouldn't be the only one way to set DB number.
I have possible situations when one Redis object using to interact with different DB numbers.

This is excellent feedback @MichKonSher, thank you!

Agreed: the constructor option, if implemented at all, should be syntactic sugar around the primary interface which will be the explicit implementation of the Redis::select() command. 👍

@holla2040
Copy link
Collaborator

Do you see a use case for selecting a DB at runtime (after the constructor is called)?

@MichKonSher
Copy link

MichKonSher commented Apr 21, 2023

@holla2040
Yes

  1. For testing. Here i can get data from evaluating DB and write data to testing DB to do not affect evaluating DB
  2. I'll use different DB-s for different environments (1 for critical home temperature regulation and 1 more for non critical info center service) and send some common data (such as temperature/humidity e.t.c) to both without needs to reconnect to Redis. Here i can split critical and non critical environments, grant external access to non critical DB, analyze it and only after it merge required data to critical segment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Development

No branches or pull requests

3 participants