GithubHelp home page GithubHelp logo

complex64 / protoc-gen-gorm Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 5.0 843 KB

Generate GORM v2 Models and APIs from your .proto files.

Home Page: https://complex64.github.io/protoc-gen-gorm/

License: Apache License 2.0

Go 97.26% Dockerfile 0.84% Makefile 1.81% CSS 0.09%
gorm gorm-v2 orm golang protoc protoc-plugin buf buf-plugin grpc sql

protoc-gen-gorm's Introduction

protoc-gen-gorm

Tests Linters Go Report Card Maintainability Go Reference

Generate GORM v2 Models and APIs from your .proto files.

protoc-gen-gorm is a plugin for protoc (or buf), a Protocol Buffer ("proto") compiler.

Actively maintained as of October 2023.

Please find the documentation here.

Additionally, there are several code examples, including a full gRPC/REST/CRUD service.

Install

go install github.com/complex64/protoc-gen-gorm@latest

Features

  • Targets Gorm v2 (gorm.io/gorm)
  • Generates GORM-compatible model struct types for your message types: UserModel for your User message
  • Generates methods to convert from proto message to model: ToModel() on the proto message, and ToProto() on the model
  • Generates CRUD helper methods for rapid and convenient implementation of APIs: Create(), Get(), List(), Update(), Patch(), and Delete()
  • Can encode fields as JSON strings when instructed to

Additionally:

  • All features are covered by tests
  • Minimal external dependencies

Planned Features:

  • Support for record lifecycle hooks (on demand)
  • Support for associations
  • Support for custom types
  • Support for database-specific types
  • Support for embedded structs
  • Code examples
  • Helpful code comments
  • Comments on generated code

Contributing

Please have a quick look at CONTRIBUTING.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.