-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow disabling of datasources by excluding packages #1323
Conversation
This allows the testing of non-db beans without requiring the connection pools to be fully configured. Does not cover r2dbc as that is defined elsewhere. micronaut-projects/micronaut-data#2893 It is done this way (with package requirements) as there is no way currently to allow EachBean to skip factory creation based on a property of the bean (ie Toggleable#isEnabled).
Quality Gate passedIssues Measures |
@@ -18,8 +18,11 @@ | |||
*/ | |||
@Configuration | |||
@Requires(classes = HikariDataSource.class) |
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.
Maybe add requires to BasicJdbcConfiguration and that should be enough for all implementations
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.
I'll try 🤔
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.
@dstepanov No, the @Requires
doesn't seem to carry through... In my tests with Hikari, we still end up with a DatasourceConfiguration
and a HikariUrlDataSource
bean
This allows the testing of non-db beans without requiring the connection pools to be fully configured.
Does not cover r2dbc as that is defined elsewhere.
micronaut-projects/micronaut-data#2893
It is done this way (with package requirements) as there is no way currently to allow EachBean to skip factory creation based on a property of the bean (ie Toggleable#isEnabled).