Skip to content

spanner: support generated column with spanner#Row.ToStruct, spanner.(Insert|Update|InsertOrUpdate)Struct  #8933

@vvakame

Description

@vvakame

Is your feature request related to a problem? Please describe.
I use spanner with struct. I want to try generated column, but spanner library’s struct operation can’t do that.
generated column can’t be wrote value, I use spanner:”-“ to struct fields. but It can’t read generated column to struct field.

Describe the solution you'd like
introduce spanner:",generated" tag to struct field. likes encoding/json 's json:",omitempty".
I want it to be ignored for spanner.InsertStruct, spanner.UpdateStruct, and spanner.InsertOrUpdateStruct, and be the target of loading for spanner#Row.ToStruct.
If not use "generated", "readonly" may be likely. likes spanner:",readonly".

Describe alternatives you've considered
use spanner.Insert (not Struct) instead. likes yo did.
However, I would like a simple solution like the proposed method, if possible, because it would require the introduction and development of new tools.

Additional context
none.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions