Skip to content

Move parameter metadata behind a view in LibsqlPreparedStatement #212

Closed

Description

@magnusp

Goal

Move the parameter metadata surface behind a view. LibsqlPreparedStatement implements both PreparedStatement and ParameterMetaData, so 66 lines of metadata methods sit in the middle of the binding code.

Depends on

None.

Pin

LibsqlPreparedStatementTest covers parameter counts and metadata after close. The xerial PrepStmtTest exercises parameter metadata.

Scope

  • Add a package-private or nested ParameterMetaDataView holding the parameter count and the closed and index checks.
  • Cache one view and return it from getParameterMetaData().
  • Keep implements ParameterMetaData on the statement. Dropping it is observable through instanceof and is not part of this pass.

Preserve

  • getParameterMetaData() throws after close, and metadata calls throw after close.
  • The index message stays "Parameter index out of range: N".
  • The parameter count still comes from SqlTokenizer.placeholderCount.

Acceptance

  • The statement class reads as binding and execution, with metadata in one view.
  • LibsqlPreparedStatement.java is under 560 lines.
  • instanceof ParameterMetaData still holds for a prepared statement.
  • ./mvnw -pl libsql-jdbc -am test green with no assertion edited.
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