Skip to content

feat: Support PreparedStatement.getMetaData()#151

Merged
mkaufmann merged 1 commit into
mainfrom
mkaufmann-prepared-statement
Feb 5, 2026
Merged

feat: Support PreparedStatement.getMetaData()#151
mkaufmann merged 1 commit into
mainfrom
mkaufmann-prepared-statement

Conversation

@mkaufmann

@mkaufmann mkaufmann commented Feb 5, 2026

Copy link
Copy Markdown
Member

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.

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

codecov Bot commented Feb 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.70%. Comparing base (b1fba90) to head (9e9c2a5).
⚠️ Report is 1 commits behind head on main.

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     
Components Coverage Δ
JDBC Core 83.86% <100.00%> (+0.14%) ⬆️
JDBC Main 40.69% <ø> (ø)
JDBC HTTP 91.09% <ø> (ø)
JDBC Utilities 66.07% <ø> (ø)
Spark Datasource ∅ <ø> (∅)
Files with missing lines Coverage Δ
...atacloud/jdbc/core/DataCloudPreparedStatement.java 97.36% <100.00%> (+0.14%) ⬆️
...sforce/datacloud/jdbc/core/DataCloudStatement.java 79.21% <100.00%> (+1.10%) ⬆️

... and 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mkaufmann mkaufmann merged commit 52448d9 into main Feb 5, 2026
19 of 22 checks passed
@mkaufmann mkaufmann deleted the mkaufmann-prepared-statement branch February 5, 2026 14:05
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants