Documentation
¶
Overview ¶
extract-enums moves the enum types that sqlc.yaml overrides to pkg/enums out of the generated models.go and into pkg/enums/enums.gen.go, so each enum has exactly one Go type shared by the repository, API and client layers. It then generates the API-facing subsets of those enums declared in pkg/enums/subsets.yaml.
Run from the repo root after sqlc generation:
go run ./hack/sqlc/extract-enums.go
Click to show internal directories.
Click to hide internal directories.