Replies: 1 comment 2 replies
-
|
Since Bob treats the database as the source of truth, it would be better to create a schema from the protobuf and use one of the existing generation tools to generate the Bob ORM from the schema. You could then additionally generate some helper glue code between the models and the protobuf. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
[Proposal] Protobuf → Bob SQL model generator (
protoc-gen-go-bob)I’d like to propose adding support for a new Protobuf code generator:
protoc-gen-go-bob.I’ve started working on an early prototype here:
https://github.com/yaroher/protoc-gen-go-bob
Please note that it is in a very early stage.
This project is heavily inspired by my other generator:
https://github.com/yaroher/protoc-gen-pgx-orm
which generates SQL schema and ORM-like builders.
Motivation
If we could generate Bob SQL models directly from Protobuf definitions, we could:
The idea is to use Protobuf as the canonical model and automatically generate Bob-compatible SQL models and helpers from it (such as schema.sql for auto generate migrations from it).
Goal
Enable seamless generation of Bob SQL bindings from Protobuf models, making database integration cleaner and more maintainable.
I’d appreciate feedback on whether this approach aligns with the project’s goals and whether such a generator would be welcome here.
Beta Was this translation helpful? Give feedback.
All reactions