gorm-generate

command module
v0.0.0-...-40038e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

README

gorm-generate

gorm-generate generates GORM structs from a live database.

Usage

To run gorm generate:

# Install the latest gorm-generate to your go workspace and build a binary.
go get -u github.com/frontdesk-anywhere/gorm-generate
go install github.com/frontdesk-anywhere/gorm-generate

# Generate gorm structs and registry.
cd ${dir_where_you_want_to_generate_structs}
gorm-generate \
    -dsn="mysql://root:root@tcp(127.0.0.1:3306)?your_database_name_here/?charset=utf8" structs

# Check the results.
cat generated_structs.go
cat generated_structs_registry.go

To use gorm-generate with go generate, add the following to the top of a go file (not with the same name as the file you will be generating) in the package you wish to generate code into:

//go:generate gorm-generate -dsn="..."

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL