https://github.com/dizzyfool/genna
Model generator for go-pg package
https://github.com/dizzyfool/genna
codegen go-pg golang postresql
Last synced: about 1 year ago
JSON representation
Model generator for go-pg package
- Host: GitHub
- URL: https://github.com/dizzyfool/genna
- Owner: dizzyfool
- License: mit
- Created: 2018-12-02T19:01:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T22:38:29.000Z (over 3 years ago)
- Last Synced: 2025-04-13T12:26:18.462Z (over 1 year ago)
- Topics: codegen, go-pg, golang, postresql
- Language: Go
- Homepage:
- Size: 325 KB
- Stars: 114
- Watchers: 4
- Forks: 24
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Genna - cli tool for generating go-pg models
[](https://goreportcard.com/report/github.com/dizzyfool/genna)
Requirements:
- [go-pg](https://github.com/go-pg/pg)
- your PostgreSQL database
### Idea
In most of the cases go-pg models represent database's tables and relations. Genna's main goal is to prepare those models by reading detailed information about PostrgeSQL database. The result should be several files with ready to use structs.
### Usage
1. Install `go get github.com/dizzyfool/genna`
1. Read though help `genna -h`
Currently genna support 3 generators:
- [model](generators/model/README.md), that generates basic go-pg model
- [model-named](generators/named/README.md), same as basic but with named structs for columns and tables (author: [@Dionid](https://github.com/Dionid))
- [search](generators/search/README.md), that generates search structs for basic model
- [validation](generators/validate/README.md), that generates validate functions for basic model
Examples located in each generator