dbgo
写项目的时候习惯先写sql表, 再写实体类, 一般的orm提供通过实体类创建表,未提供sql表转实体类功能, 因此写了基本映射规则生成entity
Github地址: https://github.com/wslky/dbgo
安装
go install github.com/wslky/dbgo@latest
使用
dbgo -u root -p 123456. -d mall -url 127.0.0.1:3306
cli参数说明
-u 数据库用户名
-p 数据库密码
-d 数据库名
-url 数据库地址
-pn 包名
-fn 文件名 支持 goStyle | go_style | gostyle(默认)
-jt json tag 支持 goStyle | go_style(默认) | gostyle