Skip to content

golangid/gostruct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Struct Generator from database

gostruct will generate struct from your DB

Build Status codecov License

Index

You can file an Issue.

Support

Currently only support Mysql for now.

Getting Started

Download

go get -u github.com/golangid/gostruct

Example

Creating Configurations

To generate the models, you need to create config.json in you project folders.

{
  "type":"mysql",
  "user":"root",
  "password":"password",
  "host":"127.0.0.1",
  "port":"33060",
  "dbname":"article"
}

then run from terminal

$GOPATH/bin/gostruct generate

# Example
~/go/bin/gostruct generate

Example to use Faker