-
Notifications
You must be signed in to change notification settings - Fork 1.5k
spanner: support generated column with spanner#Row.ToStruct, spanner.(Insert|Update|InsertOrUpdate)Struct #8933
Description
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.