feat: Support PreparedStatement.getMetaData()#151
Merged
Conversation
The JDBC standard supports `getMetaData()` calls on PreparedStatements even without executing the fully query. This change adds support for this by leveraging the `query_row_limit=0` query parameter which instructs Hyper to only produce metadata but not to actually execute the query. But that also means that the query still has to be send to the remote instance and will be checked if it is valid. Drive-By: - The Query Param logic was hard to understand being split between multiple places in Statement + `ExecuteQueryParamBuilder` classes. It turns out that the dedicated param builder class created more complexity than saving and thus the functionality is now inlined in the Statement classes (and restructured there for clearer flow). - In a previous commit I missed pushing the extended SyncIteratorAdapter + AsyncQueryResultIterator coverage which is now added here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #151 +/- ##
============================================
+ Coverage 82.59% 82.70% +0.10%
+ Complexity 1350 1345 -5
============================================
Files 112 111 -1
Lines 4062 4053 -9
Branches 413 413
============================================
- Hits 3355 3352 -3
+ Misses 515 510 -5
+ Partials 192 191 -1
🚀 New features to boost your workflow:
|
praveen2450
approved these changes
Feb 5, 2026
KaviarasuSakthivadivel
approved these changes
Feb 5, 2026
KaviarasuSakthivadivel
pushed a commit
that referenced
this pull request
Feb 5, 2026
🤖 I have created a release *beep* *boop* --- ## [0.42.0](0.41.0...v0.42.0) (2026-02-05) ### Features * Add SSL/TLS Support to DataCloud JDBC Driver ([#89](#89)) ([9123c1b](9123c1b)) * implement automated release pipeline using Release Please ([#139](#139)) ([268eb2e](268eb2e)) * Provide a low level Async Interface ([#150](#150)) ([b1fba90](b1fba90)) * Support PreparedStatement.getMetaData() ([#151](#151)) ([52448d9](52448d9)) ### Bug Fixes * Breaking - Remove data loss for slow readers ([#142](#142)) ([1ff41dc](1ff41dc)) * **ci:** remove explicit SNAPSHOT version from snapshot workflow ([#141](#141)) ([b30c3fe](b30c3fe)) * **ci:** synchronize Release Please state to resolve empty change set error ([#143](#143)) ([8518b23](8518b23)) * **ci:** use simple release-type with extra-files for Gradle project ([#145](#145)) ([5a8aac4](5a8aac4)) ### Performance Improvements * Optimize ResultSet column lookup with HashMap-based indexing ([#138](#138)) ([b8c5eb9](b8c5eb9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
KaviarasuSakthivadivel
pushed a commit
that referenced
this pull request
Feb 5, 2026
🤖 I have created a release *beep* *boop* --- ## [0.42.0](0.41.0...v0.42.0) (2026-02-05) ### Features * Add SSL/TLS Support to DataCloud JDBC Driver ([#89](#89)) ([9123c1b](9123c1b)) * implement automated release pipeline using Release Please ([#139](#139)) ([268eb2e](268eb2e)) * Provide a low level Async Interface ([#150](#150)) ([b1fba90](b1fba90)) * Support PreparedStatement.getMetaData() ([#151](#151)) ([52448d9](52448d9)) ### Bug Fixes * Breaking - Remove data loss for slow readers ([#142](#142)) ([1ff41dc](1ff41dc)) * **ci:** remove explicit SNAPSHOT version from snapshot workflow ([#141](#141)) ([b30c3fe](b30c3fe)) * **ci:** synchronize Release Please state to resolve empty change set error ([#143](#143)) ([8518b23](8518b23)) * **ci:** use simple release-type with extra-files for Gradle project ([#145](#145)) ([5a8aac4](5a8aac4)) * Remove comments from JDBC driver version ([#153](#153)) ([32f7216](32f7216)) ### Performance Improvements * Optimize ResultSet column lookup with HashMap-based indexing ([#138](#138)) ([b8c5eb9](b8c5eb9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The JDBC standard supports
getMetaData()calls on PreparedStatements even without executing the fully query. This change adds support for this by leveraging thequery_row_limit=0query parameter which instructs Hyper to only produce metadata but not to actually execute the query. But that also means that the query still has to be send to the remote instance and will be checked if it is valid.Drive-By:
ExecuteQueryParamBuilderclasses. It turns out that the dedicated param builder class created more complexity than saving and thus the functionality is now inlined in the Statement classes (and restructured there for clearer flow).