Skip to content

datastore: support conversion of protobuf ptypes directly #680

Closed
@ptone

Description

Consuming protobufs in an API (gRPC or otherwise) and then storing them in datastore is a really effective pattern, with a catch.

Protobuf supports some interesting ptypes for richer datatypes, such as timestamp, and duration.

These convert directly into similar verbose struct types in golang protobuf, but there exist helper utils to convert to native golang types

https://github.com/golang/protobuf/blob/master/ptypes/duration.go
https://github.com/golang/protobuf/blob/master/ptypes/timestamp.go

A proposal for similar support for structs was rejected
golang/protobuf#370

For these relatively limited number of ptypes, it would be nice if the conversion to golang native type, and then into datastore type was handled more easily, or perhaps an sample showing a protobuf PropertyLoadSaver implementation.

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.help wantedWe'd love to have community involvement on this issue.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions