Skip to content

Extract the xerial column type mapping from LibsqlResultSetMetaData #203

Closed

Description

@magnusp

Goal

Move the xerial 3.53.4.0 column type mapping out of LibsqlResultSetMetaData. It is a 91-line ordered if-chain inside getColumnType, plus the storage-class helper reused by three getters.

Depends on

#202. Same file.

Pin

LibsqlResultSetMetaDataTest covers first non-null value, runtime mapping inside integer columns, declared types when values are null or the result set is empty, storage-class changes between rows, isSigned, and class names.

Scope

  • Create XerialColumnType with the storage-class enum, storageClass(Value), jdbcType(Value, String), and className(Value) from LibsqlResultSetMetaData 198 to 288, 326 to 340, 381 to 395, and 658 to 664.
  • getColumnType, getColumnClassName, and isSigned delegate.

Preserve

  • The exact branch order and the way NULL participates in every storage block before falling through to Types.NUMERIC.
  • The exact declared type name set, including UNSIGNED BIG INT and DATETIME.
  • className returns Object.class for NULL and BLOB.
  • isSigned keeps its narrow set of NUMERIC, INTEGER, and REAL only.

Acceptance

  • XerialColumnType.java exists and holds the moved code unchanged.
  • LibsqlResultSetMetaData.java is under 480 lines.
  • ./mvnw -pl libsql-jdbc -am test green with no assertion edited.
  • ./mvnw -pl libsql-conformance -am verify green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority: edge case, feature gap, or test/process improvement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions