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 ForeignKeyMetadata from LibsqlDatabaseMetaData #209
Move imported and exported foreign key shaping out of LibsqlDatabaseMetaData. Two near-copy 30-line methods build a 13-field record at different offsets, and a set of static helpers serves only them.
LibsqlDatabaseMetaDataTest covers imported and exported keys, cross reference, empty databases, and constraint names. The xerial DBMetaDataTest covers column counts, named keys, mixed case, and incorrect references. DatabaseMetaDataIT covers the live path.
Scope
Create ForeignKeyMetadata with the raw row record, fromImported, fromExported, the JDBC row record, and the sort comparators.
Move the mappers from 704 to 769 and the helpers from 779 to 904.
Leave the two SQL strings in MetadataSql.
Preserve
The index asymmetries between imported and exported rows, including the primary-key column fallback.
KEY_SEQ is the pragma sequence plus one. DEFERRABILITY is always initially deferred.
nameOrEmpty turns null into "" for foreign key and primary key name, while getPrimaryKeys leaves the primary key name null.
primaryKeyName matches only CONSTRAINT <name> PRIMARY KEY, never an inline key.
foreignKeyName keeps the reverse index rule.
Exported primary key names stay blank unless the parent column set contains the column.
Acceptance
ForeignKeyMetadata.java exists and holds the moved logic unchanged.
LibsqlDatabaseMetaData.java is under 800 lines.
./mvnw -pl libsql-jdbc -am test green with no assertion edited.
Activity
refactor(jdbc): extract ForeignKeyMetadata (#232)