Skip to content

Extract SqliteDateTimeValues from LibsqlResultSet #201

Closed

Description

@magnusp

Goal

Move SQLite storage-class to date and time conversion out of LibsqlResultSet. It is about 112 lines of Julian-day math, SQLite text formats, offsets, and target-type handling.

Depends on

#200 for file order, and #195 for the missing pins.

Pin

LibsqlResultSetTest covers text, empty text, integer epoch millis, and REAL Julian day. #195 adds offset, Z, bare time, and BLOB rejection.

Scope

  • Create SqliteDateTimeValues with from(Value, String targetType) and the static helpers from LibsqlResultSet 1156 to 1276.
  • Keep a thin dateTimeValue(int, String) in the result set that calls getCurrentValue and then delegates.

Preserve

  • The getCurrentValue call stays in the cursor layer. It sets lastColumnIndex, and wasNull depends on it.
  • BLOB throws "Bad value for type " + targetType. Blank text returns null.
  • A bare time uses 2000-01-01.
  • Offsets are honored only when the sign is followed by more than nine characters. Local conversion uses ZoneId.systemDefault().
  • Exception wrapping keeps the original text.

Acceptance

  • SqliteDateTimeValues.java exists and holds the moved code unchanged.
  • LibsqlResultSet.java is under 850 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