GoogleCloudPlatform / GoogleCloudPlatform/cloud-spanner-r2dbc
Add more "standard" binders
- 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
Assessment
This issue has not been assessed yet.