feat: Provide a low level Async Interface#150
Merged
Conversation
…e cases Why: JDBC's synchronous interface is a poor fit for reactive frameworks (RxJava, Vert.x, Project Reactor) and event-driven architectures. Teams using these paradigms previously had to block threads or build custom wrappers around our protocol. Note that this layer has less strong API stability guarantees compared to the JDBC API as we might still need to evolve it. What: - New async protocol layer under `protocol/async/` with CompletionStage- based iteration over query results, chunks, and query info - Core abstractions: AsyncIterator<T>, AsyncStreamObserver for gRPC - Refactored sync iterators to extend SyncIteratorAdapter, reducing duplication while preserving existing JDBC behavior - Removed legacy BufferingStreamIterator/Observer in favor of new async-first design How: - AsyncQueryResultIterator: manages full query lifecycle asynchronously (execute → poll status → fetch chunks) - AsyncExecuteQueryIterator: handles execute query stream with QueryInfo tracking - AsyncStreamObserverIterator: wraps gRPC ClientResponseObserver as AsyncIterator with backpressure support - SyncIteratorAdapter: bridges async iterators to blocking Iterator for JDBC compatibility - Usage examples demonstrate fully async consumption patterns including error handling with QueryExceptionHandler that show how it should be used (see `com.salesforce.datacloud.jdbc.examples.AsyncQueryResultIteratorTest`)
35f8ea2 to
372902b
Compare
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (82.84%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
============================================
- Coverage 82.74% 82.59% -0.16%
- Complexity 1301 1350 +49
============================================
Files 107 112 +5
Lines 3918 4062 +144
Branches 404 413 +9
============================================
+ Hits 3242 3355 +113
- Misses 493 515 +22
- Partials 183 192 +9
🚀 New features to boost your workflow:
|
praveen2450
reviewed
Feb 3, 2026
praveen2450
approved these changes
Feb 4, 2026
KaviarasuSakthivadivel
approved these changes
Feb 4, 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.
Why:
JDBC's synchronous interface is a poor fit for reactive frameworks
(RxJava, Vert.x, Project Reactor) and event-driven architectures.
Teams using these paradigms previously had to block threads or build
custom wrappers around our protocol. Note that this layer has less strong
API stability guarantees compared to the JDBC API as we might still need to
evolve it.
What:
- New async protocol layer under
protocol/async/with CompletionStage-based iteration over query results, chunks, and query info
- Core abstractions: AsyncIterator, AsyncStreamObserver for gRPC
- Refactored sync iterators to extend SyncIteratorAdapter, reducing
duplication while preserving existing JDBC behavior
- Removed legacy BufferingStreamIterator/Observer in favor of new
async-first design
How:
- AsyncQueryResultIterator: manages full query lifecycle asynchronously
(execute → poll status → fetch chunks)
- AsyncExecuteQueryIterator: handles execute query stream with QueryInfo
tracking
- AsyncStreamObserverIterator: wraps gRPC ClientResponseObserver as
AsyncIterator with backpressure support
- SyncIteratorAdapter: bridges async iterators to blocking Iterator for
JDBC compatibility
- Usage examples demonstrate fully async consumption
patterns including error handling with QueryExceptionHandler that show how it should be used (see
com.salesforce.datacloud.jdbc.examples.AsyncQueryResultIteratorTest)