Releases: IodeSystems/sqlc-go-codegen-metaquery
Releases · IodeSystems/sqlc-go-codegen-metaquery
v1.2.0-rc1
What's new
- New public package
metaquery/codegenexportingGenerate—
the same function sqlc invokes when it spawns the installed
pluginbinary. Embedders can now wire the metaquery generator
directly into their own tooling without a separate plugin install. plugin/main.goretargeted to import the new public path. The
standalone plugin binary continues to work exactly as before.
Why
Downstream projects (e.g. ragtag) want one go run ./cmd/dev codegen
to drive sqlc generate without go install-ing the plugin to
$GOPATH/bin and renaming it. Importing metaquery/codegen.Generate
into a dev binary, then PATH-injecting that binary as the plugin,
collapses the dance into a single command.
Example
import (
"github.com/sqlc-dev/plugin-sdk-go/codegen"
mqc "github.com/iodesystems/sqlc-go-codegen-metaquery/metaquery/codegen"
)
func main() { codegen.Run(mqc.Generate) }Status
Release candidate while downstream consumers validate. No breaking
changes vs v1.1.1; the installed-plugin path is unaffected.
v1.1.1
v1.1.0
v1.0.3
v1.0.3
First stable release of sqlc-go-codegen-metaquery — a fork of sqlc-gen-go that emits per-query metadata alongside the usual sqlc output, plus a runtime for composing filters, ordering, pagination, and aggregations dynamically as CTEs.
What's new since v0.1.0
- GroupByExpr — new builder method for passing raw SQL GROUP BY expressions
- metaquery:agg annotations — per-query aggregate declarations
- Import generation fix — corrected import path generation for aggregate-related code
- mqpgx merged into parent module —
metaquery/mqpgxis now a subpackage, not a separate module; singlego getpulls everything
Features
- Drop-in compatible with stock sqlc-gen-go — existing generated methods are unchanged
- Typed query wrappers (
Wrap<QueryName>) with compile-time arg binding - Typed column references (
<QueryName>Cols) with type-appropriate operators - Runtime filter, order, pagination, and aggregation composition
- Four emission levels:
off,meta,wrap,cols - JSON-round-trippable metadata for HTTP endpoints and admin consoles
metaquery/mqpgxadapter for pgx/v5
Installation
WASM plugin
plugins:
- name: metaquery
wasm:
url: https://github.com/IodeSystems/sqlc-go-codegen-metaquery/releases/download/v1.0.3/sqlc-go-codegen-metaquery.wasm
sha256: f5aeb49aef73f7fa2c23327a0aeb420191bb6606db34a75e84ac0b064302c6b3Go module
go get github.com/iodesystems/sqlc-go-codegen-metaquery@v1.0.3
Both metaquery and metaquery/mqpgx are included in the same module.
Full changelog
- feat: add GroupByExpr, metaquery:agg annotations, and fix import generation
- fix: merge mqpgx into parent module (remove separate go.mod, add pgx to parent)
- build: add make release — publish WASM and update README