Been building proto-first for a while and got tired of keeping my DB schema 
in
sync with my protobuf messages by hand. So I wrote a protoc plugin that 
derives
the schema from the AIP annotations already on the messages
(google.api.resource, field_behavior, resource_reference) and emits GORM
structs, Postgres DDL, Prisma, or a CSV manifest — all from a single IR, so
they can't disagree.

Go-relevant bits: GORM output is one package per schema, pointer types for
nullable columns, relation fields wired from resource_reference. Built with
buf, Apache-2.0.

Design call I went back and forth on and want opinions on: nullable columns 
map
to pointer types (*string). Honest about NULL, but pointers everywhere are a
pain to work with. Alternative is sql.Null* or non-pointer + a separate
nullability signal. What would you actually want generated?

v0.1 / early. https://github.com/oh-tarnished/protorm

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/grpc-io/13df3ab9-d6b9-48df-b85d-45b90997d478n%40googlegroups.com.

Reply via email to