From 6a641a6b5bfda85c326b80c1d8cf53ddad64a3b3 Mon Sep 17 00:00:00 2001 From: Roman Odermatt Date: Sun, 30 Aug 2026 18:12:35 +0200 Subject: [PATCH 1/2] package moved --- .github/workflows/release.yaml | 2 +- CLAUDE.md | 8 ++++---- Dockerfile | 2 +- README.md | 14 +++++++------- buf.gen.yaml | 4 ++-- buf.plugin.yaml | 8 ++++---- buf.yaml | 2 +- cmd/protoc-gen-go-sqlmap/main.go | 2 +- docs/design/DESIGN-SUBTYPE-TABLES.md | 2 +- go.mod | 2 +- pkg/generated/schema/v1/schema.pb.go | 4 ++-- pkg/generated/sqlmap/v1/sqlmap.pb.go | 6 +++--- pkg/generator/sqlmap/e2e_test.go | 16 ++++++++-------- pkg/generator/sqlmap/generator.go | 10 +++++----- pkg/generator/sqlmap/golden_test.go | 4 ++-- .../sqlmap/testdata/eager.sqlmap.go.golden | 4 ++-- .../sqlmap/testdata/foreignkey.sqlmap.go.golden | 4 ++-- .../sqlmap/testdata/relation.sqlmap.go.golden | 4 ++-- .../sqlmap/testdata/simple.sqlmap.go.golden | 4 ++-- .../sqlmap/testdata/subtype.sqlmap.go.golden | 4 ++-- .../testdata/subtype_fieldnames.sqlmap.go.golden | 4 ++-- pkg/generator/sqlmap/types/column.go | 4 ++-- pkg/generator/sqlmap/types/relation.go | 4 ++-- pkg/generator/sqlmap/types/subtype.go | 2 +- pkg/generator/sqlmap/types/table.go | 2 +- pkg/migration/migration.go | 2 +- pkg/migration/migration_test.go | 2 +- pkg/writer/query/writer.go | 6 +++--- pkg/writer/scanner/writer.go | 8 ++++---- pkg/writer/schema/writer.go | 8 ++++---- 30 files changed, 74 insertions(+), 74 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 952d709..74a14fc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,7 +41,7 @@ jobs: run: gh release create "$GITHUB_REF_NAME" --title "Release $GITHUB_REF_NAME" --generate-notes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # The BSR remote plugin, so consumers can use `remote: buf.build/roderm/ + # The BSR remote plugin, so consumers can use `remote: buf.build/snaerverk/ # go-sqlmap` instead of installing the binary. Runs after `release` because # buf.plugin.yaml's license_url points at the tag's LICENSE. plugin: diff --git a/CLAUDE.md b/CLAUDE.md index a0de45b..4cae2df 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,22 +6,22 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co `protoc-gen-go-sqlmap` is a `protoc`/`buf` code-generator plugin. Given `.proto` messages annotated with `sqlmap` extensions (table/column metadata, primary keys, foreign keys), it emits a `.sqlmap.go` per proto file containing `schema.v1.SchemaTable`/`SchemaColumn` values plus row-scanning helpers. `pkg/migration` then converts those values into `ariga/atlas` schema types to create tables or write migration files. -The goal is a set of independently switchable plugins over one shared `TableRepo`: (1) atlas migrations — **done**; (2) queries with eager loading of children + FieldMask support — **done**; (3) SQL filters built from the filtrify AST (`github.com/roderm/filtrify`, `proto/filtrify/ast/v1/ast.proto`). Note `docs/plans/sqlmap-generator/PLAN-SQLMAP-GENERATOR.md` is stale on (3): its Phase 5 sketches ad-hoc per-column builder funcs rather than translating an external AST. +The goal is a set of independently switchable plugins over one shared `TableRepo`: (1) atlas migrations — **done**; (2) queries with eager loading of children + FieldMask support — **done**; (3) SQL filters built from the filtrify AST (`github.com/snaerverk/filtrify`, `proto/filtrify/ast/v1/ast.proto`). Note `docs/plans/sqlmap-generator/PLAN-SQLMAP-GENERATOR.md` is stale on (3): its Phase 5 sketches ad-hoc per-column builder funcs rather than translating an external AST. Plugins are toggled with the `plugins=` protoc parameter, a **`+`-separated** list (protoc already uses `,` between parameters): `--go-sqlmap_out=plugins=schema+scanner:.`. Omitting it enables everything. `plugins` entries live in one slice in `generator.go`; `query` declares `Requires: ["scanner"]` because its output calls the scanner's `Result` type, and enabling it alone is a generation-time error rather than uncompilable Go. ### BSR remote plugin -`buf.plugin.yaml` + `Dockerfile` publish the generator as `buf.build/roderm/go-sqlmap`, so consumers need no local binary: +`buf.plugin.yaml` + `Dockerfile` publish the generator as `buf.build/snaerverk/go-sqlmap`, so consumers need no local binary: ```yaml plugins: - - remote: buf.build/roderm/go-sqlmap:v0.1.0 + - remote: buf.build/snaerverk/go-sqlmap:v0.1.0 out: pkg/generated/ opt: [paths=source_relative, plugins=schema+scanner+query] ``` -`buf.plugin.yaml` pins the runtime module the generated code imports (`pkg/query`, `pkg/generated/schema/v1`), so `plugin_version` and `registry.go.deps` must both match the git tag — the release workflow fails if they drift. Publishing happens in CI on tag (`buf beta registry plugin push`, needs `BUF_TOKEN`); it is a separate resource from the `buf.build/roderm/protoc-gen-go-sqlmap` *module* that carries the protos. Test the image locally with `docker build -t x . && protoc --plugin=protoc-gen-y=