erm

module
v0.0.0-...-ada6ab3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: MIT

README

erm — GraphQL + ORM codegen for Go (Relay, pgx v5, OIDC)

Status: design + bootstrap skeleton (alpha).
Goal: Generate an opinionated, production-grade GraphQL backend that fully supports the Relay Server Spec (global Node IDs + cursor-based connections) on top of a schema-as-code ORM with code generation—built for PostgreSQL via jackc/pgx v5 and secured by OIDC (default mapping for Keycloak).

  • DX & AI-friendly: one-command scaffolds, rich comments, consistent conventions, and LLM-ready docs & prompts.
  • Relay-complete: Node interface, global ObjectID, connections/edges, PageInfo, opaque cursors.
  • ORM: ent-like schema-as-code: fields, edges, indexes, views, mixins, annotations; hooks, interceptors, privacy policies, transactions, predicates, eager loading, traversal, pagination, ordering, aggregations, and migrations.
  • PostgreSQL first-class: batteries-included support for extensions: PostGIS, pgvector, TimescaleDB.
  • IDs: UUID v7 by default at the ORM layer (generated app-side).
  • CLI: erm provides init, new, gen, and graphql init workflows.

See: PRD, Roadmap, Agents, Orchestrator.


Quickstart (local)

Download the latest binary from the GitHub Releases page and place it on your PATH, or use go install github.com/deicod/erm/cmd/erm@latest if you're iterating on the source.

mkdir myproj && cd myproj
go mod init github.com/yourname/myproj
go mod tidy
# Assuming 'erm' binary is on PATH, else: go run ./cmd/erm
erm init
erm new User
erm gen
erm graphql init

Generated app uses:

  • gqlgen for GraphQL. Autobind is disabled by default; opt in with erm graphql init --autobind (or manually add the autobind block to graphql/gqlgen.yml) once your project has the supporting Node helpers and enum wrappers in place.
  • OIDC middleware (pluggable claims mapping; default Keycloak).
  • pgx/v5 pools + migrations.

To keep custom business logic safe across regenerations, follow the patterns in Customizing generated code safely.

License

MIT © 2025 deicod / contributors

Directories

Path Synopsis
cli
cmd
api command
erm command
examples
dataloaders
Code generated by erm.
Code generated by erm.
resolvers
Code generated by erm.
Code generated by erm.
observability
orm
dsl
gen
Code generated by erm.
Code generated by erm.
id
pg
Package testkit provides helpers for exercising generated ORM and GraphQL layers in tests.
Package testkit provides helpers for exercising generated ORM and GraphQL layers in tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL