Merged
Conversation
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.
🚀 PR Comment: R2DBC Support Added
Overview
This PR introduces R2DBC (Reactive Relational Database Connectivity) support to the terpal-sql library, enabling fully reactive, non-blocking database access alongside the existing JDBC implementation.
🎯 Main Feature: R2DBC Support
The highlight of this commit is the addition of comprehensive R2DBC support with the following key components:
New Module Structure
controller-r2dbc: Core R2DBC controller implementation providing the foundation for reactive database operationsterpal-sql-r2dbc: R2DBC SQL module with complete test coverageMulti-Database Support
The R2DBC implementation supports multiple database vendors out of the box through specialized controllers in
R2dbcControllers:Type Encoding/Decoding
The R2DBC implementation includes comprehensive type encoding support:
Database-Specific Quirks Handled
The implementation carefully handles various database-specific behaviors:
🔧 Minor Changes & Improvements
Enhanced Error Reporting
New
DecodingErrorexception class: Added a specializedControllerError.DecodingErrorsubclass for more precise error categorization during decoding operations.Improved error messages: Error messages now include index type description (zero-based vs one-based) for easier debugging:
dbTypeIsRelevant()method: Controllers can now indicate whether database type information should be included in error messages. R2DBC controllers returnfalsesince R2DBC doesn't use JDBC types.Safe column info access: Added
columnInfoSafe(index)method that gracefully handlesIndexOutOfBoundsExceptioninstead of throwing, preventing cascading errors during error reporting.StartingIndexEnhancementsThe
StartingIndexsealed interface now includes adescriptionproperty:Zero.description= "zero-based"One.description= "one-based"This provides clearer context in error messages about whether indices are zero-based (R2DBC) or one-based (JDBC).
Code Quality Improvements
EncodingContextparametersstartingIndexanddbTypeIsRelevantfor better encoding context awareness📊 Test Coverage
The PR includes comprehensive test suites for R2DBC across multiple databases: