Repository navigation
Spanner - Allow set/get of com.google.cloud.spanner.Value #1838
Description
Activity
- addedapi: spannerIssues related to the Spanner API.Issues related to the Spanner API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
on Mar 30, 2017 @sai-pullabhotla Can you please describe you use case. Why do you need these methods?
@vkedia - the purpose is to have a generic way to set/get data using an interface or generic type. I'm in the process of developing a ORM framework similar to the one I did for Cloud Datastore (Catatumbo), and having these methods would help with mapping types defined in the domain model to Spanner and vice versa. See Mapper for more info on how the mapping was done in Catatumbo, hoping to do the same for Spanner and having these methods would help. I also see another issue, #1805, which appears to be similar to what I'm asking for.
Moreover, the API already does this internally to convert the distinct types to Value objects, so just need to expose a public method. Snippet from ValueBinder is below:
public R to(@Nullable String value) { return handle(Value.string(value)); }@sai-pullabhotla Thanks. This sounds interesting. So if we had a to(Value) you would still need to figure out what type of Value to create, right? So it is not complete generic?
- addedpriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.
on May 30, 2017 The feature request is added to the backlog. The issue will be closed but is linked in the backlog and can continue to be used for comment and discussion.
- added a commit that references this issue
on Dec 22, 2025 - added a commit that references this issue
on Jan 22, 2026 - added a commit that references this issue
on Feb 24, 2026 - added a commit that references this issue
on Mar 11, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 20, 2026 - added a commit that references this issue
on Mar 23, 2026 - added 5 commits that reference this issue
on Apr 29, 2026
Is it possible to add methods to respective interfaces and classes to get/set instances of com.google.cloud.spanner.Value in addition to the distinct types that are currently supported?
For example -
ResultSet.getValue()andValueBinder.to(Value v)