# go-gorm/gen

Gen:  Friendly & Safer GORM powered by Code Generation

Repository: https://github.com/go-gorm/gen
Canonical: https://ross.abutalabs.com/products/gen
Homepage: https://gorm.io/gen/
Language: Go
License: MIT
License Family: permissive
Topics: generator, golang, gorm
Last push: 2026-08-26T15:24:29+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 1876, "days_push": 7, "days_rel": 8, "gap_med": 84, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2558, forks 356 (observed 2026-08-28T04:07:00.849322+00:00)

## What it is
GORM Gen is a code-generation library built on top of the GORM ORM for Go. It generates type-safe DAO APIs and query DSL code from database schemas and interface-based SQL templates, eliminating runtime type errors in database access.

## Use cases
- generate type-safe database query code for Go
- avoid interface{} in GORM queries
- generate DAO layer from database schema
- write dynamic raw SQL with type safety
- convert database tables to Go structs following GORM conventions

## When to choose
- you use GORM and want compile-time type safety for queries
- you want generated, reusable DAO APIs instead of hand-written query code
- you need dynamic SQL templates with static typing

## When to avoid
- you don't use GORM or prefer raw SQL drivers
- your project is too small to justify a code-generation step
- you need an ORM for a language other than Go

## Facets
- artifact type: library
- maturity: active
- function: orm, database, type-system
- domain: databases, backend, developer-tools, web-development
- platform: go, windows, cli
- tags: gorm, dao, type-safe-queries, sql-templates, code-generator, code-generation, linux, macos

## Member repositories
- go-gorm/gen (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:00.849322+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:23:37.878114+00:00, confidence not recorded.
  - readme: https://github.com/go-gorm/gen (fetched 2026-08-28T04:07:00.849322+00:00, sha 48697fa844d9)
  - homepage: https://gorm.io/gen/ (fetched 2026-08-29T10:06:10.818075+00:00, sha 9e15f488a8af)
  - site_page: https://gorm.io/docs (fetched 2026-08-29T10:06:10.827650+00:00, sha 990bf2b7b335)
- Data as of 2026-08-30T08:39:29.467469+00:00.
