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
Extract TableMetadataResolver from LibsqlResultSetMetaData #205
Move table metadata lookup out of LibsqlResultSetMetaData. The class currently implements ResultSetMetaData and also queries sqlite_master, pragma_table_info, and pragma_database_list, with attached-schema fallback and a negative cache.
Depends on
#204 for file order, and #195 because the attached-schema branch has no test today.
Pin
LibsqlResultSetMetaDataTest covers aliases, joins, subqueries, RETURNING, views, USING and NATURAL star expansion, generated columns, width mismatches, and non-ASCII names. #195 adds the attached-schema case.
Scope
Create TableMetadataResolver holding the connection, SQL, column count, lazy resolution, and the LinkedHashMap cache, from LibsqlResultSetMetaData 35 and 397 to 527.
Move the ColumnInfo and TableInfo records with it.
Keep tableForColumn(int) as the single entry point for the three callers.
Preserve
tableContextResolved stays a separate boolean. A resolved null is not an unresolved state.
The negative cache uses containsKey and put. Do not switch to computeIfAbsent.
Temp before main fallback, hidden != 1, and COLLATE NOCASE in both queries.
Lowercased cache keys with the original-case name returned.
SqlTableReference.resolve receives the column list copy in order.
Acceptance
TableMetadataResolver.java exists and holds the moved code unchanged.
LibsqlResultSetMetaData.java is under 300 lines.
./mvnw -pl libsql-jdbc -am test green with no assertion edited, including the new attached-schema pin.
Activity