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

Improve Npgsql health check design #2116

Merged
merged 5 commits into from
Dec 15, 2023
Merged

Commits on Dec 4, 2023

  1. try to improve Npgsql design:

    - make NpgSqlHealthCheckOptions.DataSource internal, so the users can't make mistakes by assigning it to a new data source for every health check invocation
    - make sure not more than a single DataSource is created
    - when the user provides ConnectionString, try to resolve DataSource just once. If it's present and the connection string is the same, reuse it
    adamsitnik committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    09b9fdd View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2023

  1. further design improvements:

    - offer two public NpgSqlHealthCheckOptions ctors: one that requires ConnectionString and another that requires DataSource. This allows us to ensure that every instance of this type is valid.
    - make DataSource property public, but readonly. This allows us to ensure that the customers are not providing both.
    adamsitnik committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    22ba6ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5503ccb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    07ae4b5 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2023

  1. keep it simple: don't try to resolve the DataSource from the DI if on…

    …ly a connection string was provided
    adamsitnik committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    3e8a1be View commit details
    Browse the repository at this point in the history