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

Add runtime configuration property quarkus.datasource.active #38108

Merged
merged 3 commits into from Jan 17, 2024

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Jan 9, 2024

Fixes #37265

Creating as draft, because this is based on #38106 , which should be merged first. => Done

I tried to explain the feature in the documentation: see changes to docs/src/main/asciidoc/datasource.adoc and docs/src/main/asciidoc/hibernate-orm.adoc. Please let me know if something is not clear.

Best reviewed commit-by-commit: I split the implementation and tests. Tests are numerous, part because of the widespread impact of disabling a datasource (on flyway, metrics, health, ...), part because of the duplication of SQL client (needs one test per DB vendor).

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 9, 2024

/cc @gsmet (hibernate-orm)

@quarkus-bot quarkus-bot bot added this to To do in Quarkus Documentation Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

🙈 The PR is closed and the preview is expired.

@yrodiere yrodiere force-pushed the datasource-active branch 2 times, most recently from 5c7d067 to a4a58e4 Compare January 10, 2024 13:33
@yrodiere yrodiere changed the title Add runtime configuration property quarkus.datasource.active Add runtime configuration property quarkus.datasource.active Jan 15, 2024
@yrodiere yrodiere marked this pull request as ready for review January 15, 2024 15:56
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Looks good. I think I spotted a small typo in the doc, could you have a look?

Comment on lines 453 to 454
you can select a persistence unit/datasource at runtime simply by passing
xref:config-reference.adoc#multiple-profiles[setting configuration property `quarkus.profile`]:
Copy link
Member

Choose a reason for hiding this comment

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

simply by passing setting configuration property quarkus.profile

sounds weird?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. I rephrased to:

simply by setting quarkus.profile

(and I did the same for the other occurrence)

Copy link
Member Author

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

Thanks! I addressed your comment and rebased on main.

Comment on lines 453 to 454
you can select a persistence unit/datasource at runtime simply by passing
xref:config-reference.adoc#multiple-profiles[setting configuration property `quarkus.profile`]:
Copy link
Member Author

Choose a reason for hiding this comment

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

Right. I rephrased to:

simply by setting quarkus.profile

(and I did the same for the other occurrence)

Quarkus Documentation automation moved this from To do to Reviewer approved Jan 17, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 17, 2024

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@yrodiere yrodiere merged commit e7c8069 into quarkusio:main Jan 17, 2024
47 checks passed
Quarkus Documentation automation moved this from Reviewer approved to Done Jan 17, 2024
@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Jan 17, 2024
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Jan 17, 2024
@gsmet gsmet modified the milestones: 3.9 - main, 3.7.0 Jan 23, 2024
@yrodiere yrodiere deleted the datasource-active branch January 29, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Support for de-activating a datasource at runtime (application startup)
2 participants