Skip to content

Add more "standard" binders #932

@lukaseder

Description

@lukaseder

The readme mentions the following binder support:

  • BYTES -> java.nio.ByteBuffer (this doesn't actually seem to be supported. Only com.google.cloud.ByteArray is supported, it seems from code in com.google.cloud.spanner.r2dbc.v2.ClientLibraryBinder)
  • DATE -> com.google.cloud.Date
  • JSON -> com.google.cloud.spanner.r2dbc.v2.JsonWrapper
  • TIMESTAMP -> com.google.cloud.Timestamp

See:

It is inconvenient for client libraries (especially third parties) to have dependencies on cloud-spanner-r2dbc or cloud-core data types. It would be better, in my opinion, to support:

  • LocalDate as an equivalent of com.google.cloud.Date
  • Instant or OffsetDateTime as an equivalent of com.google.cloud.Timestamp
  • String as an alternative for JsonWrapper

At the same time, I wonder if more array types could be supported, e.g. Long[] or Integer[]. long[] doesn't support null elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions