# smallnest/gen

Converts a database into gorm structs and RESTful api

Repository: https://github.com/smallnest/gen
Canonical: https://ross.abutalabs.com/products/smallnest-gen
Language: Go
License: Apache-2.0
License Family: permissive
Topics: generator, gorm, database, databases, rest-api, rest, restful, restful-api
Last push: 2023-04-24T10:18:15+00:00

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

## Adoption (not part of the score)
Stars 1439, forks 230 (observed 2026-08-28T04:04:44.050615+00:00)

## What it is
A Go CLI code generator that connects to an existing database, analyzes its schema, and produces GORM-compatible struct definitions with gorm, JSON, db, and protobuf tags. It can also scaffold a complete CRUD RESTful API project template from the database.

## Use cases
- generate gorm structs from an existing database schema
- scaffold a CRUD REST API from database tables
- convert mysql or sqlite tables into go structs with  tags
- generate nullable column types for go structs
- bootstrap a go backend project from a legacy database

## When to choose
- you have an existing database and want Go structs or a REST API generated from it
- you use GORM and want tags and model methods generated automatically
- you want a quick scaffold for CRUD endpoints over your tables

## When to avoid
- you prefer writing models by hand or use a different ORM
- you need a runtime ORM library rather than a one-time code generator
- your schema changes frequently and you need live migrations

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: orm, api-framework, database
- domain: databases, backend, developer-tools, apis
- platform: cli, go, cross-platform
- tags: gorm, rest-api, database-to-code, crud, scaffolding, codegen, code-generation

## Member repositories
- smallnest/gen (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:44.050615+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-30T04:36:37.446013+00:00, confidence not recorded.
  - readme: https://github.com/smallnest/gen (fetched 2026-08-28T04:04:44.050615+00:00, sha 2f26613a1760)
- Data as of 2026-08-30T08:39:29.467469+00:00.
