Repository navigation
refactor(jdbc): extract AUTOINCREMENT grammar - #220
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 #202
Moves the AUTOINCREMENT grammar out of
LibsqlResultSetMetaDatainto package-privateSqlAutoIncrement(same package), and points both call sites at it. The package-private seam no longer lives on the metadata class.What moved
SqlAutoIncrement.java:isAutoIncrementColumn,tableDefinitions,columnDefinitionIsAutoIncrement,tableConstraintIsAutoIncrement,indexedColumnIsAutoIncrement,skipConstraintName,isConstraintKeyword,containsKeyword.LibsqlResultSetMetaData.isAutoIncrementnow callsSqlAutoIncrement.isAutoIncrementColumn(...)and keeps theinfo.primaryKey()requirement.LibsqlDatabaseMetaData.getColumnsnow callsSqlAutoIncrement.isAutoIncrementColumn(...)and keeps theprimaryKey &&guard.pom.xml, type-mapping, declared-type, or table-resolver code changed.Verbatim proof
Old method blocks (
origin/mainlines 73–88 and 529–648) vs newSqlAutoIncrementlines 11–147, whitespace-normalized (trailing whitespace trimmed, blank lines dropped):The only non-code delta is the single blank separator line between the two extracted method groups; the original separator was blank line 89.
Probe
Perturbed comment skipping in
SqlTokenizerso a block comment emitted its body as aWORDtoken, making the keyword inside/* AUTOINCREMENT */visible tocontainsKeyword:Reverted with
git checkout -- .../SqlTokenizer.java;git status --porcelainthen listed only the three intended files.Line counts
LibsqlResultSetMetaData.java: 680 → 544 lines (limit < 580).SqlAutoIncrement.java: 148 lines (new).git diff --stat: 3 files changed, 152 insertions(+), 140 deletions(-).Lanes
./mvnw -pl libsql-jdbc -am test→ 392 tests, 0 failures, 0 errors, 0 skipped../mvnw spotless:apply→ BUILD SUCCESS;./mvnw spotless:check→ BUILD SUCCESS (no reformat needed)../mvnw -pl libsql-conformance -am verify→ 272 tests, 0 failures, 0 errors, 7 skipped (matches baseline).