Skip to content

Add redis database selection#101

Merged
ejsmith merged 6 commits intoFoundatioFx:mainfrom
BlueCurveCorp:add-redis-db-selection
May 19, 2025
Merged

Add redis database selection#101
ejsmith merged 6 commits intoFoundatioFx:mainfrom
BlueCurveCorp:add-redis-db-selection

Conversation

@TeddyAlbina
Copy link
Copy Markdown
Contributor

Actually is it not possible to setup the redis database to use. This evolution aims to add this possibility.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Teddy ALBINA seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@TeddyAlbina
Copy link
Copy Markdown
Contributor Author

Signer the CLA but it keeps saying it's not the case :/

Copy link
Copy Markdown
Member

@niemyjski niemyjski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for this PR! I left a few comments and would love your thoughts around db constraints.

@niemyjski niemyjski requested review from Copilot and ejsmith May 15, 2025 02:10
@niemyjski
Copy link
Copy Markdown
Member

Signer the CLA but it keeps saying it's not the case :/

No worries

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the ability to select a specific Redis database for queues and cache clients. Key changes include:

  • Introducing a new nullable DbId property to options classes.
  • Adding builder methods (UseDatabase) to set the database index.
  • Updating database accessor logic in queue and cache client classes to pass the selected database index.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Foundatio.Redis/Queues/RedisQueueOptions.cs Added DbId property and UseDatabase builder method for queue options.
src/Foundatio.Redis/Queues/RedisQueue.cs Updated constructor and Database property to use the provided DbId.
src/Foundatio.Redis/Cache/RedisHybridCacheClientOptions.cs Added UseDatabase builder method in cache client options.
src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs Integrated the DbId update in the client configuration chain.
src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs Added DbId property and UseDatabase builder method in cache options.
src/Foundatio.Redis/Cache/RedisCacheClient.cs Updated DbId assignment, Database property, and related calls to use DbId.

Database property is no longer nullable and its default value is set to -1
The UseDatabase methods checks if the database identifier is valid
Remove _dbId and replace it with _options.Database
Copy link
Copy Markdown
Contributor

@ejsmith ejsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Thanks!

@TeddyAlbina TeddyAlbina requested review from ejsmith and niemyjski May 16, 2025 23:44
@TeddyAlbina
Copy link
Copy Markdown
Contributor Author

CLA signature fixed 🥳🥳🥳🥳

@ejsmith ejsmith merged commit ec74c00 into FoundatioFx:main May 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants