https://github.com/ekhabarov/go-pg-generator
Golang struct generator for PostgreSQL
https://github.com/ekhabarov/go-pg-generator
cli generator golang postgres postgresql sql
Last synced: 2 months ago
JSON representation
Golang struct generator for PostgreSQL
- Host: GitHub
- URL: https://github.com/ekhabarov/go-pg-generator
- Owner: ekhabarov
- License: mit
- Created: 2017-01-09T20:05:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-13T06:29:31.000Z (6 months ago)
- Last Synced: 2025-04-06T07:54:47.029Z (2 months ago)
- Topics: cli, generator, golang, postgres, postgresql, sql
- Language: Go
- Size: 12.7 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang struct generator for PostgreSQL
CLI tool for generation Golang structures by table definition from PostgreSQL.
## Build
Install Go vendor tool [govendor](https://github.com/kardianos/govendor) and run
```
make build
```## Dependencies
### For generated files
`import "github.com/guregu/null/v5"`
Provides support for `null` values.`import "github.com/satori/go.uuid"`
Provides support for `uuid.UUID` values.## Help
```
Usage:
go-pg-generator [OPTIONS]Application Options:
-s, --server= Server name or IP address (default: 127.0.0.1)
-p, --port= Port (default: 5432)
-u, --user= Database user.
-w, --password= Database password.
-d, --database= Database name.
-t, --tables= Tables to export.
--ssl= SSL mode (require|verify-full|verify-ca|disable) (default: disable)
-f, --file-per-table Save each structure to its own .go file.
--package= Package name for generated files.Help Options:
-h, --help Show this help message
```