gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
487 stars 40 forks source link

Is there a Protobuf example? #134

Closed mmendez512 closed 4 years ago

mmendez512 commented 4 years ago

My team has a brand new microservice project where we want to generate our go db models and protobuf files (for grpc) directly from the db schema.

On the gnorm site, it mentions we can generate protobufs from templates. I'm just curious if there's a simple example on how to do this.

Thanks.

freb commented 4 years ago

I generate a proto file using Gnorm. It outputs message types for each table and additional messages to support the request and response messages for the CRUD RPCs it also generates. If you're just looking for message generation, the template could be paired down.

I'd be happy to prepare a PR for an example if @natefinch is open to accepting it. Otherwise I'm happy to just upload the config and template file here.

natefinch commented 4 years ago

I would welcome a PR for generating gRPC. :)

mmendez512 commented 4 years ago

Thanks @freb!!

freb commented 4 years ago

@natefinch where should I add the example, to the gnormal/postgres-go? The GRPC example requires an additional toml file and the example already there is at the root of the repo. I wasn't sure if this would be confusing. Let me know what you think.

natefinch commented 4 years ago

hmm, it probably should be in its own repo. I can make one for you.

On Thu, Mar 5, 2020 at 7:07 PM Jeff Stiles notifications@github.com wrote:

@natefinch https://github.com/natefinch where should I add the example, to the gnormal/postgres-go? The GRPC example requires an additional toml file and the example already there is at the root of the repo. I wasn't sure if this would be confusing. Let me know what you think.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gnormal/gnorm/issues/134?email_source=notifications&email_token=AAYJZSFLQT5Y2FBUXIESIXTRGA5DRA5CNFSM4LB7VBI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN7F4PI#issuecomment-595484221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYJZSDABZ2EQMI7LA7SI6DRGA5DRANCNFSM4LB7VBIQ .

natefinch commented 4 years ago

https://github.com/gnormal/gRPC

freb commented 4 years ago

See: https://github.com/gnormal/gRPC/pull/1

mmendez512 commented 4 years ago

Thanks guys! Going to close out this issue now there's a PR open.