Repository navigation
refactor(jdbc): shape getColumns rows through named records - #230
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.
Fixes #208
What
Replaces the positional shaping in
getColumnswith named records.COLUMN_COLUMNS: the 24Colentries lifted to a static constant besideFOREIGN_KEY_COLUMNS. Values and order unchanged.ColumnMetadata(new, package-private): the wholegetColumnsshape.PragmaRow.fromRow(Row)names the ninepragma_table_xinfopositions once.JdbcRow.toRow()names every one of the 24 JDBC columns.columnShape/ColumnShapemoved verbatim fromLibsqlDatabaseMetaData, where they had no other caller.getColumnsnow delegates toColumnMetadata.columns(raw, COLUMN_COLUMNS)and contains no positionalvalues.get(n).Preserved exactly:
IS_AUTOINCREMENTis the primary-key flag and the grammar result;IS_GENERATEDCOLUMNishidden == 2 || hidden == 3;NULLABLEderives fromnotnullonly;REMARKSstays NULL; theSQL_*andSCOPE_*columns keep their values;NUM_PREC_RADIXstays the literal10;BUFFER_LENGTHandCHAR_OCTET_LENGTHstay2_000_000_000. No SQL text touched.Diff
Line counts:
LibsqlDatabaseMetaData.java949 -> 846 (target under 900); newColumnMetadata.java177.Probe
Set
NULLABLEto alwayscolumnNullableinJdbcRow.toRow(), then:Reverted; the full suite is green afterward.
Lanes
./mvnw -pl libsql-jdbc -am test./mvnw spotless:check./mvnw -pl libsql-conformance -am verifyNo test assertion edited, no
pom.xmlchange.