Repository navigation
refactor(jdbc): extract xerial column type mapping - #221
Merged
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.
Summary
Extracts the xerial 3.53.4.0 column type mapping out of
LibsqlResultSetMetaDatainto a package-privateXerialColumnType. Move only: the ordered if-chain, the storage-class helper,className, the storage-class enum, and the singleinteger(Value)helper (also used bytoTableInfo).XerialColumnTypeholdsstorageClass(Value),jdbcType(Value, String),className(Value),integer(Value), and theStorageClassenum.getColumnType,getColumnClassName, andisSigneddelegate.getColumnTypekeeps the original evaluation order:getColumnTypeNamebeforeruntimeValue.Nothing else changes. No test, pom, declared-type parsing, AUTOINCREMENT parser, or table resolver touched.
Fixes #203
Verbatim proof (normalized diff, empty)
Moved blocks: old
LibsqlResultSetMetaData188-272 (getColumnTypebody), 311-325 (className), 366-380 (storageType), 518-528 (integer+SampleType). Compared against the corresponding blocks inXerialColumnType.Normalization is renames plus visibility only:
SampleType->StorageClass,storageType->storageClass, and theprivatemodifier dropped because the moved members are package-private by design.Branch order, the
NULLparticipation in every storage block beforeTypes.NUMERIC, the declared type name set (UNSIGNED BIG INT,DATETIMEincluded),classNamereturningObject.classfor NULL/BLOB, and the narrowisSignedset (NUMERIC,INTEGER,REAL) all move unchanged.integer(null)is still0.Probe
Deleted the
BOOLEANarm from the INTEGER branch inXerialColumnType.jdbcType, then ran the declared-type test:16isTypes.BOOLEAN,2isTypes.NUMERIC. Reverted;git statusclean apart from the two intended files, and the full lane is green again.Line counts
LibsqlResultSetMetaData.javaXerialColumnType.javaGates
./mvnw -pl libsql-jdbc -am test./mvnw spotless:applythen./mvnw spotless:check./mvnw -pl libsql-conformance -am verifyBaseline on
main: 392 JDBC tests and 272 conformance tests (7 skipped). No assertion edited.