-
Notifications
You must be signed in to change notification settings - Fork 11
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
Adds DataOptionsSetup #456
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add MultiDataOptionsSetup support * Add/improve default HOCON settings * Move DataOptions usage in Hosting extension to its own extension method * Move DataOptions properties to SqlJournalOptions and SqlSnapshotOptions * Make sure that all config files have correct equality method * Make sure that all config files returns a proper hash code * Make sure that AkkaPersistenceDataConnectionFactory uses the proper DataOptions * Use DataOptions.GetHashCode if config.DataOptions is not null * Always use DataOptions RetryPolicy if it is defined * Remove RetryPolicy property from AkkaDataConnection (dead code) * Make sure that SqlWriteJournal, SqlReadJournal and SqlSnapshotStore applies the correct DataOptionsSetup * Use DataOptions from DataOptionsSetup if it is defined * Use/override DataOptions from MultiDataOptionsSetup if it exist for the current plugin id
Aaronontheweb
approved these changes
Sep 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - went through this over a call with @Arkatufus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #18
Changes
Adds a DataOptionsSetup class to be able to configure custom DataOptions for linq2db
Remarks
I didn’t want to add whole new PersistenceSetup class, so it’s just a Setup for the DataOptions. Otherwise, there would be three ways to configure the plugin, and more testing would be necessary.
If the data options are provided, the user must add the provider and the connection string again (if needed). Linq2Db checks for different configuration variations, and always adding the connection string and the provider name would exclude some configurations (like a connection factory).
See here
In this first version I didn’t include a Multi Setup class, like AzureTableStorageMultiJournalSetup. Would this be a blocker to a PR?
I didn’t include a test for this setup, because the configs are patched in the corresponding Journal/Snapshot classes. So I really don’t know where or how to put it. Do you have an advise on this?
The
Copy
Methods and private constructors like here could be replaced by records withwith
copying. But I didn't want to make any potential breaking changes.Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):