Make DataSourceBuilder be able to derive driverClassName from a URL #39376
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.
When using DataSourceBuilder to "deriveFrom" another DataSource, it is possible that the other Datasource has a getter for url, but not driverClassName. In this case, when the url is derived from the the provided DataSource, the DataSourceBuilder should try to derive the driverClassName from this derived url.
The use case is that when using Liquibase it is possible that a pooling DataSource is used that does not provide a getDriverClassName(). When using different credentials to run Liquibase with a DataSource, the user and password of LiquibaseProperties should be used and the DataSource should be "derivedFrom" the provided DataSource. This DataSource may provide a getUrl() but not a getDriverClassName(). In this case the driverClassName could also be "derived from" the "derived" url. This way, other custom (Pooling) DataSources may be used to run Liquibase using different credentials to connect to the 'same' DataSource.