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

Custom driver name disables hibernate support of advanced postgres types #370

Closed
1 of 2 tasks
maciejwo-papayaglobal opened this issue Mar 23, 2023 · 5 comments
Closed
1 of 2 tasks
Assignees
Labels
enhancement New feature or request

Comments

@maciejwo-papayaglobal
Copy link

Describe the feature

For postgres-like databases, Hibernate ORM uses driver name obtained via DatabaseMetaData::getDriverName to determine driver kind, which affects the way advanced types are handled. Would id be possible to allow passthrough of the underlying driver name in certain situations?

https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDriverKind.java#L27
https://github.com/hibernate/hibernate-orm/blob/6.2/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java#L1342

Use Case

I'd like to be able to configure wrapped driver to use original driver name, so that hibernate correctly recognises it and enables native support for advanced types.

Proposed Solution

Perhaps an additional property could be defined to enable driver-name passthrough from the wrapped driver?

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

The AWS Advanced JDBC Driver version used

1.0.1

JDK version used

Temurin-17.0.6+10

Operating System and version

macOS 13.2.1

@maciejwo-papayaglobal maciejwo-papayaglobal added the enhancement New feature or request label Mar 23, 2023
@karenc-bq karenc-bq self-assigned this Mar 23, 2023
@karenc-bq
Copy link
Contributor

Hi @maciejwo-papayaglobal, thank you for raising this issue. We are currently working on a solution for this, we will keep you posted on our progress.

@karenc-bq
Copy link
Contributor

Hi @maciejwo-papayaglobal, we merged #371 which introduces a new connection plugin allowing user applications to override the driver name. Here is an example on how the plugin can be used: https://github.com/awslabs/aws-advanced-jdbc-wrapper/blob/main/examples/AWSDriverExample/src/main/java/software/amazon/DriverMetaDataConnectionPluginExample.java

Can you please check out our snapshot build and let us know if the issue persists? Thank you.

@maciejwo-papayaglobal
Copy link
Author

@karenc-bq it works, thank you! Sorry for late reply, I didn't expect it to be acted upon so quickly 😅

A minor question: as is, there's no way to passthrough the driver name from the underlying driver, only explicit value can be set. Would it be ok to do passthrough if the wrapperDriverName property is not set? Or perhaps another property, like i.e. wrapperDriverNamePassthrough is set to true? I can prepare a PR if you think it would be acceptable.

Regardless of the passthrough, thank you very much for help! ❤️

@karenc-bq
Copy link
Contributor

Hi @maciejwo-papayaglobal, please feel free to create a PR for your proposed changes. We appreciate your help! Thank you.

@maciejwo-papayaglobal
Copy link
Author

Thanks @karenc-bq! I'll prepare a PR, in the mean time, this issue is resolved, thank you very much for help! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants