GoogleCloudPlatform / GoogleCloudPlatform/cloud-spanner-r2dbc

Add more "standard" binders

Open
#932 1 comment 0 reactions 0 assignees View on GitHub
feature P3
Dominant language
Java
Stars
60
Forks
31
PR merge metrics
No merged PRs in 30d

Description

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:

- https://github.com/GoogleCloudPlatform/cloud-spanner-r2dbc?tab=readme-ov-file#mapping-of-data-types

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.