-
-
Notifications
You must be signed in to change notification settings - Fork 90
Description
[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:
- Eliminate the tight coupling between API models and database models
- Remove repetitive boilerplate code for translating between Protobuf and DB layers
- Ensure a single source of truth for data structures
- Simplify production code and reduce maintenance overhead
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.