Spanner: support custom key type encode/decode #2747
Labels
api: spanner
Issues related to the Spanner API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
I wanna use custome type with spanner.Key likes #854 / #2614
expected.
We should be write like
spanner.Key{string(todo.TodoID)}
now. It's annoying & easy to make bug.compiler can't check this problem.
Describe the solution you'd like
support spanner.Encoder to keyPartValue function and Key#String method.
Describe alternatives you've considered
make utility function likes
func toSpannerKey(id TodoID) spanner.Key
.Additional context
I wrote up some code to this issue. I'll submit PR to this repo.
The text was updated successfully, but these errors were encountered: