Repository navigation
refactor(jdbc): extract parameter stream reads - #279
Merged
Merged
Conversation
magnusp
force-pushed
the
refactor/parameter-streams
branch
from
October 31, 2026 10:39
469e1ec to
09e147e
Compare
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.
What changed
Moved the six private stream readers out of
LibsqlPreparedStatementinto a package-privateParameterStreams. The setters keep the JDBC surface and the parameter index handling.ParameterStreamsowns the conversion of anInputStreamorReaderinto the bytes, text, orValuethat a setter binds.Behavior preserved
Every setter binds the same
Value. Every exception type and message is unchanged, including the length bounds, the short-stream messages, and the read-failure messages. A null stream still binds SQL NULL. The public API is unchanged.Pins added
nullStreamsBindSqlNullstreamLengthOutsideIntRangeUsesTheXerialMessageintlengths keepData must have a length between 0 and Integer.MAX_VALUE.shortBinaryStreamUsesTheXerialMessageEnd of stream reached before 5 bytes were read.shortCharacterStreamUsesTheXerialMessageEnd of stream reached before 5 characters were read.binaryReadFailureKeepsTheXerialMessageIOExceptionkeepsCannot read from binary stream: boom.characterReadFailureKeepsTheXerialMessageIOExceptionkeepsCannot read from character stream: boom.asciiStreamDecodesAsAsciiAndUnicodeStreamDecodesAsUtf8Mutant kills
bytestochars.Diff (file statistics)
Line counts
LibsqlPreparedStatement.javaParameterStreams.javaProbe
The first probe changed the ASCII decoder to UTF-8, and the decoding pin failed. The second probe changed the short byte-stream message from
bytestochars, and the message pin failed. Both probes were reverted before the final lane run.Lanes
mise exec -- ./mvnw -pl libsql-jdbc -am testmise exec -- ./mvnw spotless:checkmise exec -- ./mvnw -pl libsql-conformance -am verifyDOCKER_CONFIG=... mise exec -- ./mvnw -pl libsql-itests -am verify./mvnw spotless:check)../mvnw clean verify).Closes #278