Skip to content

feat: support named prepared statements - #197

Open
mkaufmann wants to merge 1 commit into
mainfrom
feat/named-prepared-statement
Open

feat: support named prepared statements#197
mkaufmann wants to merge 1 commit into
mainfrom
feat/named-prepared-statement

Conversation

@mkaufmann

@mkaufmann mkaufmann commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

Add a Hyper-specific prepared statement API for native named parameters while preserving standard JDBC positional prepared statements.

Named setters are exposed through a separate DataCloudNamedPreparedStatement rather than being added to DataCloudPreparedStatement. Hyper accepts either positional or named parameters for a query, but does not support mixing both parameter styles. Keeping them as separate statement types makes that backend constraint explicit and prevents callers from combining incompatible setters on one statement instance.

What changed

  • Add DataCloudConnection.prepareNamedStatement(String) returning DataCloudNamedPreparedStatement.
  • Support named setters for the driver's existing scalar parameter types, including exact quoted names such as :"order total".
  • Share execution, type conversion, metadata, timeout, and parameter serialization logic between positional and named statements through a package-private base class.
  • Encode named Arrow fields directly from parameter names; binding order is not significant, repeated SQL references share one binding, and rebinding replaces the value.
  • Preserve typed SQL nulls where supported, encode untyped nulls compatibly with Hyper, and reject unsupported null parameter types before serialization.
  • Document named parameter usage in the README.

Model: aisuite/gpt-5.6-sol · Effort: default · Co-Authored-By: Claude

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.69565% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.15%. Comparing base (9b21396) to head (ac89e81).

Files with missing lines Patch % Lines
...loud/jdbc/core/DataCloudPreparedStatementBase.java 84.24% 14 Missing and 9 partials ⚠️
...oud/jdbc/core/DataCloudNamedPreparedStatement.java 70.83% 14 Missing ⚠️
...force/datacloud/jdbc/protocol/data/ArrowUtils.java 63.15% 2 Missing and 5 partials ⚠️
.../datacloud/jdbc/protocol/data/VectorPopulator.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #197      +/-   ##
============================================
+ Coverage     80.95%   81.15%   +0.19%     
- Complexity     1723     1785      +62     
============================================
  Files           123      125       +2     
  Lines          5042     5152     +110     
  Branches        523      541      +18     
============================================
+ Hits           4082     4181      +99     
- Misses          728      729       +1     
- Partials        232      242      +10     
Components Coverage Δ
JDBC Core 81.22% <83.69%> (+0.23%) ⬆️
JDBC Main 57.42% <ø> (ø)
JDBC HTTP 90.55% <ø> (ø)
JDBC Utilities 65.25% <ø> (ø)
Spark Datasource ∅ <ø> (∅)
Files with missing lines Coverage Δ
...force/datacloud/jdbc/core/DataCloudConnection.java 57.34% <100.00%> (+0.30%) ⬆️
...atacloud/jdbc/core/DataCloudPreparedStatement.java 100.00% <100.00%> (+8.28%) ⬆️
.../datacloud/jdbc/protocol/data/VectorPopulator.java 83.01% <50.00%> (+2.12%) ⬆️
...force/datacloud/jdbc/protocol/data/ArrowUtils.java 73.80% <63.15%> (+2.38%) ⬆️
...oud/jdbc/core/DataCloudNamedPreparedStatement.java 70.83% <70.83%> (ø)
...loud/jdbc/core/DataCloudPreparedStatementBase.java 84.24% <84.24%> (ø)

... and 2 files 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 marked this pull request as ready for review August 7, 2026 08:11
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.

1 participant