-
Notifications
You must be signed in to change notification settings - Fork 4
Refactor connection string handling for flexibility #712
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
Conversation
Replaced direct usage of connection strings with a function that retrieves the connection string. This change allows for runtime generation or modification of the connection string. Updates were made across multiple files, including `BaseSqlRepository.cs`, `SessionRepository.cs`, `StorageRepository.cs`, `SqlServerPersistentStorage.cs`, `SqlServerPersistentStorageSettings.cs`, `SqlServerStorageExtensions.cs`, and `SqlStorageTests.cs`. The connection string is now accessed via a `ConnectionStringFunc` delegate, and corresponding tests have been updated to reflect this new structure.
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.
Benchmark
Benchmark suite | Current: 10e6977 | Previous: 22d4209 | Ratio |
---|---|---|---|
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.InnerJoin |
405484905.5555556 ns (± 7225634.860015955 ) |
458826533.3333333 ns (± 10640413.19005047 ) |
0.88 |
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.LeftJoin |
483645072.2222222 ns (± 29506729.027620878 ) |
564994640 ns (± 28550338.329818636 ) |
0.86 |
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.ProjectionAndNormalization |
149457300 ns (± 21283094.506569188 ) |
169842820 ns (± 7144067.768715523 ) |
0.88 |
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.SumAggregation |
168910850 ns (± 11171747.746087996 ) |
171581250 ns (± 12415362.812660772 ) |
0.98 |
FlowtideDotNet.Benchmarks.Stream.StreamBenchmark.ListAggWithMapAggregation |
1832900220 ns (± 98416435.89018159 ) |
1982296640 ns (± 123349811.75190067 ) |
0.92 |
This comment was automatically generated by workflow using github-action-benchmark.
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.
Pull Request Overview
This PR refactors the connection string handling to improve flexibility by replacing direct usage with a delegate-based approach.
- Updated multiple files to call ConnectionStringFunc() instead of using a hardcoded ConnectionString.
- Added an overload in SqlServerStorageExtensions to accept a connection string function, and updated tests accordingly.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
SqlServerStorageExtensions.cs | Added overload to accept Func and updated connection string usage |
BaseSqlRepository.cs | Replaced direct connection string usage with connection string function calls |
SqlServerPersistentStorageSettings.cs | Changed connection string property type from string to Func |
SqlServerPersistentStorage.cs | Updated connection string usage to use the delegate function |
SessionRepository.cs | Updated connection string usage to call ConnectionStringFunc() |
SqlStorageTests.cs | Updated settings to return connection string via Func |
StorageRepository.cs | Replaced ConnectionString with ConnectionStringFunc() in SQL connection creation |
Looks great, would be super if the docs could be updated as well |
Updated docs with an example of the new functionality. |
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
Replaced direct usage of connection strings with a function that retrieves the connection string.
This change allows for runtime generation or modification of the connection string. Updates were made across multiple files, including
BaseSqlRepository.cs
,SessionRepository.cs
,StorageRepository.cs
,SqlServerPersistentStorage.cs
,SqlServerPersistentStorageSettings.cs
,SqlServerStorageExtensions.cs
, andSqlStorageTests.cs
.The connection string is now accessed via a
ConnectionStringFunc
delegate, and corresponding tests have been updated to reflect this new structure.