Skip to content

Releases: IodeSystems/sqlc-go-codegen-metaquery

v1.2.0-rc1

25 May 22:46

Choose a tag to compare

v1.2.0-rc1 Pre-release
Pre-release

What's new

  • New public package metaquery/codegen exporting Generate
    the same function sqlc invokes when it spawns the installed
    plugin binary. Embedders can now wire the metaquery generator
    directly into their own tooling without a separate plugin install.
  • plugin/main.go retargeted 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

22 May 21:58

Choose a tag to compare

Built from tag v1.1.1. See README for usage.

v1.1.0

22 May 10:56

Choose a tag to compare

Built from tag v1.1.0. See README for usage.

v1.0.3

16 May 03:26

Choose a tag to compare

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 modulemetaquery/mqpgx is now a subpackage, not a separate module; single go get pulls 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/mqpgx adapter 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: f5aeb49aef73f7fa2c23327a0aeb420191bb6606db34a75e84ac0b064302c6b3

Go 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