Create golang struct from ddl
go get github.com/realsangil/ddl2struct
ddl2struct [flags]
-c, --copy copy to clipboard
-h, --help help for ddl2struct
-i, --input string sql file path
-o, --output string output file path
ddl2struct -i example.sql
# ____ ____ __ ____ __ ____ ____ ____ _ _ ___ ____
# ( ( ( ) (_ _/ \ / ___(_ _( _ / )( \/ __(_ _)
# ) D () D / (_/\ )(( O ) \___ \ )( ) ) \/ ( (__ )(
# (____(____\____/ (__)\__/ (____/(__)(__\_\____/\___)(__)
===============================================================
TableName: ddl2struct
ColumnCount: 5
Save your times: About 10 seconds
===============================================================
type ddl2struct struct {
Personid int `json:"personid" gorm:"Column:personid"`
Lastname string `json:"lastname" gorm:"Column:lastname"`
Firstname string `json:"firstname" gorm:"Column:firstname"`
Address string `json:"address" gorm:"Column:address"`
City string `json:"city" gorm:"Column:city"`
}
👤 realsangil
- Website: blog.realsangil.net
- Github: @realsangil
Give a ⭐️ if this project helped you!
Copyright © 2020 realsangil.
This project is Apache License 2.0 licensed.
This README was generated with ❤️ by readme-md-generator