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 ConnectionMetadata.getDatabaseMajorVersion() and getDatabaseMinorVersion() #204

Open
lukaseder opened this issue Mar 24, 2021 · 2 comments
Labels
type: enhancement A general enhancement

Comments

@lukaseder
Copy link
Contributor

Feature Request

Is your feature request related to a problem? Please describe

When working with JDBC's DatabaseMetaData, I don't recall having ever used DatabaseMetaData.getDatabaseProductVersion(), which returns a string. The String is maybe useful to display in logs, or whatever, but in programmatic version specific logic, I've always appreciated the DatabaseMetaData.getDatabaseMajorVersion() and DatabaseMetaData.getDatabaseMinorVersion() methods much more. Querying them is much less error prone than relying on some string unformatting.

Describe the solution you'd like

Would be useful to have these methods also in R2DBC

Describe alternatives you've considered

Well, for now, I'll just parse the strings that the drivers offer me, or I ignore the versions.

Teachability, Documentation, Adoption, Migration Strategy

R2DBC tends to return nullable Integer types for compatibility reasons, so drivers can opt in to implementing these methods or just return null.

@mp911de
Copy link
Member

mp911de commented Mar 24, 2021

Version numbers can be tricky because every server is doing versions differently (SQL Server 2018, version 14.00.3365, Postgres 13, version 13, and so on). We could follow the JDBC model and let drivers and consumers try to make sense out of the information.

It would be good to get a bit more opinions and how that information is used by folks that depend on the database version so we can come up with something useful.

@mp911de mp911de added status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement labels Mar 24, 2021
@lukaseder
Copy link
Contributor Author

Version numbers can be tricky because every server is doing versions differently (SQL Server 2018, version 14.00.3365, Postgres 13, version 13, and so on). We could follow the JDBC model and let drivers and consumers try to make sense out of the information.

Sure, it's weird. But it works in JDBC :)

It would be good to get a bit more opinions and how that information is used by folks that depend on the database version so we can come up with something useful.

Yeah, not the most pressing issue

@mp911de mp911de removed the status: pending-design-work Needs design work before any code can be developed label May 4, 2021
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

No branches or pull requests

2 participants