You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Split SqlTableReference.Parser into focused units #206
Split SqlTableReference.Parser into focused units. One 789-line inner class currently mixes token navigation, SQL grammar, schema binding, and I/O, and parseSource alone is 144 lines.
Depends on
#195. The parser warms the metadata cache during parsing, so pin the attached-schema path first.
Pin
SqlTableReferenceTest has 34 cases covering star expansion, USING and NATURAL, joins, aliases, quoted and non-ASCII names, CTEs, views, RETURNING, and rejected input. LibsqlResultSetMetaDataTest covers the integration path.
Scope
Add SqlCursor over the token list and depth, replacing the repeated bounds guards.
Extract FromClauseParser (sources, joins, INDEXED, USING, star list).
Extract SelectItemParser (items, aliases, star expansion, expression labels).
Extract TableBinding (CTE, view, and definition to Source construction).
Replace the parallel labels and tables lists with one result builder that enforces the pairing.
Preserve
Schema.definition is called during parsing, once per source occurrence, in source order, and its SQLException propagates.
The view cycle guard stays add before recurse and remove in finally, keyed by schema plus lower-cased table.
CREATE VIEW is tokenized twice today. That fixes the explicit column list.
The token depth convention stays as is. ( carries pre-increment depth and ) post-decrement.
The column-count width guard stays where it is relative to caching.
targetTable remains AS-only and lenient about a third dotted part.
Acceptance
All four new units exist, and SqlTableReference.java is under 450 lines.
./mvnw -pl libsql-jdbc -am test green with no assertion edited.
Activity