{"id":13740842,"url":"https://github.com/walterwanderley/sqlc-grpc","last_synced_at":"2026-01-12T02:02:28.876Z","repository":{"id":64931217,"uuid":"369915860","full_name":"walterwanderley/sqlc-grpc","owner":"walterwanderley","description":"Create a gRPC server from code generated by sqlc","archived":false,"fork":false,"pushed_at":"2025-12-20T02:32:49.000Z","size":1103,"stargazers_count":155,"open_issues_count":3,"forks_count":18,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-12-22T11:51:05.253Z","etag":null,"topics":["grpc","sqlc","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walterwanderley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"walterwanderley","liberapay":"walterwanderley"}},"created_at":"2021-05-22T22:17:50.000Z","updated_at":"2025-12-20T02:32:35.000Z","dependencies_parsed_at":"2023-11-30T04:28:11.596Z","dependency_job_id":"f587e8d0-20b2-4840-83a0-73e467ad811e","html_url":"https://github.com/walterwanderley/sqlc-grpc","commit_stats":null,"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"purl":"pkg:github/walterwanderley/sqlc-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterwanderley%2Fsqlc-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterwanderley%2Fsqlc-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterwanderley%2Fsqlc-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterwanderley%2Fsqlc-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walterwanderley","download_url":"https://codeload.github.com/walterwanderley/sqlc-grpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walterwanderley%2Fsqlc-grpc/sbom","scorecard":{"id":1239594,"data":{"date":"2025-11-03","repo":{"name":"github.com/walterwanderley/sqlc-grpc","commit":"d7bc4949a9d8d9816ce6e27c23e37fcef64e4dda"},"scorecard":{"version":"v5.3.1-0.20251106164954-c65a663bf4a9","commit":"c65a663bf4a93c0f6eca32e6d34713d3e3440e11"},"score":2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/22 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#packaging"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: _examples/authors/pgx/Dockerfile:1: pin your Docker image by updating golang:1.21 to golang:1.21@sha256:4746d26432a9117a5f58e95cb9f954ddf0de128e9d5816886514199316e4a2fb","Warn: containerImage not pinned by hash: _examples/authors/sqlite/Dockerfile:1: pin your Docker image by updating golang:1.25 to golang:1.25@sha256:6ca9eb0b32a4bd4e8c98a4a2edf2d7c96f3ea6db6eb4fc254eef6c067cf73bb4","Warn: containerImage not pinned by hash: _examples/booktest/Dockerfile:1: pin your Docker image by updating golang:1.21 to golang:1.21@sha256:4746d26432a9117a5f58e95cb9f954ddf0de128e9d5816886514199316e4a2fb","Warn: goCommand not pinned by hash: _examples/authors/pgx/Dockerfile:3","Warn: goCommand not pinned by hash: _examples/authors/sqlite/Dockerfile:3","Warn: goCommand not pinned by hash: _examples/booktest/Dockerfile:3","Warn: goCommand not pinned by hash: _examples/authors/pgx/gen.sh:6","Warn: goCommand not pinned by hash: _examples/authors/sqlite/gen.sh:6","Warn: goCommand not pinned by hash: _examples/booktest/gen.sh:6","Info:   0 out of   3 containerImage dependencies pinned","Info:   0 out of   6 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: https://osv.dev/GO-2025-3528","Warn: Project is vulnerable to: https://osv.dev/GHSA-m6hq-p25p-ffr2","Warn: Project is vulnerable to: https://osv.dev/GHSA-pwhc-rpq9-4c8w","Warn: Project is vulnerable to: https://osv.dev/GO-2025-3829","Warn: Project is vulnerable to: https://osv.dev/GO-2025-3770","Warn: Project is vulnerable to: https://osv.dev/GO-2025-4017","Warn: Project is vulnerable to: https://osv.dev/GO-2025-3487","Warn: Project is vulnerable to: https://osv.dev/GO-2025-3503","Warn: Project is vulnerable to: https://osv.dev/GO-2025-3595","Warn: Project is vulnerable to: https://osv.dev/GO-2024-3344","Warn: Project is vulnerable to: https://osv.dev/GO-2024-3302","Warn: Project is vulnerable to: https://osv.dev/GO-2024-3321","Warn: Project is vulnerable to: https://osv.dev/GO-2024-3333"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-11-09T05:26:11.131Z","repository_id":64931217,"created_at":"2025-11-09T05:26:11.138Z","updated_at":"2025-11-09T05:26:11.138Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","sqlc","sqlite"],"created_at":"2024-08-03T04:00:52.831Z","updated_at":"2026-01-12T02:02:28.870Z","avatar_url":"https://github.com/walterwanderley.png","language":"Go","readme":"[![LiberaPay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/walterwanderley/donate)\r\n[![receives](https://img.shields.io/liberapay/receives/walterwanderley.svg?logo=liberapay)](https://liberapay.com/walterwanderley/donate)\r\n[![patrons](https://img.shields.io/liberapay/patrons/walterwanderley.svg?logo=liberapay)](https://liberapay.com/walterwanderley/donate)\r\n\r\n## sqlc-grpc\r\n\r\nCreate a **gRPC** (and **HTTP/JSON**) **Server** from the generated code by the awesome [sqlc](https://sqlc.dev/) project. If you’re searching for a SQLC plugin, use [sqlc-gen-go-server](https://github.com/walterwanderley/sqlc-gen-go-server/).\r\n\r\n### Requirements\r\n\r\n- Go 1.25 or superior\r\n- [sqlc](https://sqlc.dev/)\r\n- [buf](https://buf.build/)\r\n\r\n```sh\r\ngo install github.com/sqlc-dev/sqlc/cmd/sqlc@latest\r\ngo install github.com/bufbuild/buf/cmd/buf@latest\r\n```\r\n\r\n### Installation\r\n\r\n```sh\r\ngo install github.com/walterwanderley/sqlc-grpc@latest\r\n```\r\n\r\n### Example\r\n\r\n1. Create a queries.sql file:\r\n\r\n```sql\r\n--queries.sql\r\n\r\nCREATE TABLE authors (\r\n  id   BIGSERIAL PRIMARY KEY,\r\n  name text      NOT NULL,\r\n  bio  text,\r\n  created_at TIMESTAMP\r\n);\r\n\r\n-- name: GetAuthor :one\r\n-- http: GET /authors/{id}\r\nSELECT * FROM authors\r\nWHERE id = $1 LIMIT 1;\r\n\r\n-- name: ListAuthors :many\r\n-- http: GET /authors\r\nSELECT * FROM authors\r\nORDER BY name;\r\n\r\n-- name: CreateAuthor :one\r\n-- http: POST /authors\r\nINSERT INTO authors (\r\n  name, bio, created_at\r\n) VALUES (\r\n  $1, $2, $3\r\n)\r\nRETURNING *;\r\n\r\n-- name: DeleteAuthor :exec\r\n-- http: DELETE /authors/{id}\r\nDELETE FROM authors\r\nWHERE id = $1;\r\n\r\n-- name: UpdateAuthorBio :exec\r\n-- http: PATCH /authors/{id}/bio\r\nUPDATE authors\r\nSET bio = $1\r\nWHERE id = $2;\r\n```\r\n\r\n2. Create a sqlc.yaml file\r\n\r\n```yaml\r\nversion: \"2\"\r\nsql:\r\n- schema: \"./queries.sql\"\r\n  queries: \"./queries.sql\"\r\n  engine: \"postgresql\"\r\n  gen:\r\n    go:\r\n      out: \"internal/author\"\r\n```\r\n\r\n3. Execute sqlc\r\n\r\n```sh\r\nsqlc generate\r\n```\r\n\r\n4. Execute sqlc-grpc\r\n\r\n```sh\r\nsqlc-grpc -m \"mymodule\"\r\n```\r\n\r\n5. Run the generated server\r\n\r\n```sh\r\ngo run . -db [Database Connection URL] -dev\r\n```\r\n\r\n6. Enjoy!\r\n\r\n- Swagger UI [http://localhost:5000/swagger](http://localhost:5000/swagger)\r\n\r\n### Highly Availability SQLite with go-ha\r\n\r\nExample: [https://github.com/walterwanderley/sqlc-grpc/tree/main/_examples/authors/sqlite](https://github.com/walterwanderley/sqlc-grpc/tree/main/_examples/authors/sqlite)\r\n\r\n### Customizing HTTP endpoints\r\n\r\nYou can customize the HTTP endpoints generated by grpc-gateway by adding comments to the queries.\r\n\r\n```sql\r\n-- http: Method Path\r\n```\r\n\r\nHere’s an example of a queries file that has a custom HTTP endpoint:\r\n```sql\r\n-- name: ListAuthors :many\r\n-- http: GET /authors\r\nSELECT * FROM authors\r\nORDER BY name;\r\n\r\n-- name: UpdateAuthorBio :exec\r\n-- http: PATCH /authors/{id}/bio\r\nUPDATE authors\r\nSET bio = $1\r\nWHERE id = $2;\r\n```\r\n\r\n\r\n### Editing the generated code\r\n\r\n- It's safe to edit any generated code that doesn't have the `DO NOT EDIT` indication at the very first line.\r\n\r\n- After modify a SQL file, execute these commands below:\r\n\r\n```sh\r\nsqlc generate\r\ngo generate\r\n```\r\n\r\n- After modify a *.proto file, execute `buf generate`.\r\n\r\n### Similar Projects\r\n\r\n- [xo-grpc](https://github.com/walterwanderley/xo-grpc)\r\n","funding_links":["https://github.com/sponsors/walterwanderley","https://liberapay.com/walterwanderley","https://liberapay.com/walterwanderley/donate"],"categories":["Language-Specific"],"sub_categories":["Go"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalterwanderley%2Fsqlc-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalterwanderley%2Fsqlc-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalterwanderley%2Fsqlc-grpc/lists"}