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

Make DataSourceBuilder be able to derive driverClassName from a URL #39376

Conversation

ronaldmik
Copy link

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.

@pivotal-cla
Copy link

@ronaldmik Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@ronaldmik Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 1, 2024
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Apr 19, 2024
@philwebb
Copy link
Member

Flagging to see if the team think we should consider this a bug and target the fix to 3.1 or an enhancement for 3.x

@wilkinsona
Copy link
Member

Feels like an enhancement to me. @LiquibaseDataSource could be used as a workaround in the meantime.

@philwebb philwebb added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Apr 22, 2024
@philwebb philwebb added this to the 3.x milestone Apr 22, 2024
@wilkinsona wilkinsona self-assigned this Jul 22, 2024
@wilkinsona wilkinsona modified the milestones: 3.x, 3.4.x, 3.4.0-M2 Jul 22, 2024
@wilkinsona
Copy link
Member

Thanks very much, @ronaldmik.

@wilkinsona wilkinsona changed the title Make DataSourceBuilder be able to derive driverClassName from derived url Make DataSourceBuilder be able to derive driverClassName from a URL Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants