Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pablojimpas/protoc-gen-sqlc
Protocol Buffers plugin to generate SQL schema and queries with sqlc annotations.
https://github.com/pablojimpas/protoc-gen-sqlc
code-generation code-generator connectrpc crud crud-generator generator go grpc mysql orm postgresql protobuf rpc sql sqlc sqlite
Last synced: about 1 month ago
JSON representation
Protocol Buffers plugin to generate SQL schema and queries with sqlc annotations.
- Host: GitHub
- URL: https://github.com/pablojimpas/protoc-gen-sqlc
- Owner: pablojimpas
- License: bsd-3-clause
- Created: 2024-06-25T13:19:37.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-11-27T23:35:48.000Z (2 months ago)
- Last Synced: 2024-12-13T02:07:50.364Z (about 2 months ago)
- Topics: code-generation, code-generator, connectrpc, crud, crud-generator, generator, go, grpc, mysql, orm, postgresql, protobuf, rpc, sql, sqlc, sqlite
- Language: Go
- Homepage:
- Size: 124 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# protoc-gen-sqlc
[![Go Reference](https://pkg.go.dev/badge/github.com/pablojimpas/protoc-gen-sqlc/.svg)](https://pkg.go.dev/github.com/pablojimpas/protoc-gen-sqlc/)
[![Go CI](https://github.com/pablojimpas/protoc-gen-sqlc/actions/workflows/go.yaml/badge.svg)](https://github.com/pablojimpas/protoc-gen-sqlc/actions/workflows/go.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/pablojimpas/protoc-gen-sqlc)](https://goreportcard.com/report/github.com/pablojimpas/protoc-gen-sqlc)Protocol Buffers plugin to generate SQL schema and queries with
[sqlc](https://sqlc.dev/) annotations.## Why?
## Install
You can download and compile the latest version from source using Go directly:
```shell
go install github.com/pablojimpas/protoc-gen-sqlc/cmd/protoc-gen-sqlc@latest
```or you can download pre-built binaries from the [Github releases
page](https://github.com/pablojimpas/protoc-gen-sqlc/releases/latest).## Usage
### With `buf`
To use `buf` you have to make a config file called `buf.gen.yaml` with your
options, like this:```yaml
version: v2
plugins:
- local: protoc-gen-sqlc
out: out
```And then run `buf generate`. See [the documentation on buf
generate](https://buf.build/docs/reference/cli/buf/generate#usage) for more
help.### With `protoc`
This plugin works with `protoc` as well. Here's a basic usage example:
```shell
protoc example.proto --sqlc_out=gen
```## General Idea
![Idea diagram](./docs/diagrams/idea.svg)
## Schema Build Process
![Generate schema sequence diagram](./docs/diagrams/schema-seq.svg)