Skip to content

sql2struct is a tool for sql statement to golang struct

License

Notifications You must be signed in to change notification settings

dxc0522/sql2struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc License

sql2struct

mysql/postgresql database to golang struct for gorm model

install

go install github.com/dxc0522/sql2struct@latest

usage

# 直接执行
sql2struct --dsn="mysql://root:123456@tcp(localhost:3306)/test?charset=utf8mb4"

# 读取文件执行
# 无dsn则自动读取./etc/config.yaml 文件下的
# DBConfig:
#  DSN: mysql://root:123456@tcp(localhost:3306)/test?charset=utf8mb4
sql2struct -t "user,to_do"

support

  • mysql
  • postgreSQL

About

sql2struct is a tool for sql statement to golang struct

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published