Skip to content

Shape getColumns rows through named records #208

Closed

Description

@magnusp

Goal

Replace the positional shaping in getColumns with named records. The 74-line method rebuilds 24 Col entries on every call and reads nine row positions by magic index.

Depends on

#207. Same file.

Pin

LibsqlDatabaseMetaDataTest.getColumnsReportsDeclaredTypesSizesNullabilityAndAutoIncrement asserts all 24 columns for four rows. The xerial DBMetaDataTest adds generated columns, precision and scale, and column order.

Scope

  • Lift the 24 Col entries to a static constant beside FOREIGN_KEY_COLUMNS.
  • Add a record for the pragma row and one for the JDBC row, with fromRow and toRow.
  • Keep NUM_PREC_RADIX as the literal 10, not DEFAULT_DECIMAL_DIGITS.
  • Keep BUFFER_LENGTH and CHAR_OCTET_LENGTH at 2_000_000_000.

Preserve

  • IS_AUTOINCREMENT stays primaryKey and the grammar result. IS_GENERATEDCOLUMN stays hidden == 2 or 3.
  • NULLABLE derives from notnull only, never from the primary key.
  • REMARKS stays NULL, and the SQL_* and SCOPE_* columns keep their current values.

Acceptance

  • getColumns shapes rows through named accessors, with no positional values.get(n) left.
  • LibsqlDatabaseMetaData.java is under 900 lines.
  • ./mvnw -pl libsql-jdbc -am test green with no assertion edited.
  • ./mvnw spotless:check 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

    P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions