Skip to content

Row abstraction hides useful information #59

Description

@ratamaa

Row interface does not currently provide

  • Number of columns in the row (so you could iterate over them when e.g. selecting *)
  • Names of columns (this information could be easily made available, preferably in the index order)
  • Types of columns (now you have to know them beforehand, which narrows the applicable use cases of this generic driver) E.g. the Postgres type integer could be fine but also the Oid could work (if the id field had getter). If you don't want to expose the Postgres-specific types, also the standard java.sql.Types integer (see https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java#L68-L94 ) could work.

It is also currently quite impossible to get this information even if you cast Row into PgRow since PgColumn is package private. Could it be public?

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions