当前位置:网站首页>根据msql表的结构自动生成gorm的struct
根据msql表的结构自动生成gorm的struct
2022-07-29 13:32:00 【祥仔先生】
仓库地址
package main
import (
"fmt"
"github.com/gohouse/converter"
)
func main() {
err := converter.NewTable2Struct().
SavePath("./model.go").
Dsn("用户名:密码@tcp(IP:端口号)/数据库名?charset=utf8").
TagKey("gorm").
EnableJsonTag(true).
Table("表名").
Run()
fmt.Println(err)
}边栏推荐
猜你喜欢
随机推荐
关闭线程池 shutdown 和 shutdownNow 的区别
Project Manager: Not bad!The SSO single sign-on code is written, and the sequence diagram is also drawn?
了解 AQS 底层原理
Vscode builds ESP32-C3 development environment
Super young!34-year-old professor, vice president of 985 Ace College!
期货合约知多少
BGP联邦综合实验
How to Improve Embedded Programming with MISRA
抓住这几个关键点,做薪酬数据分析并不难
企业如何走出固定资产管理的困境?
[10:00 Open Class]: Application Exploration of Kuaishou GPU/FPGA/ASIC Heterogeneous Platform
【JS高级】js之闭包对象_04
AI全流程开发难题破解之钥
浅谈MES系统质量管理的方案
3555. 二叉树
IJCAI 2022杰出论文公布,大陆作者中稿298篇拿下两项第一
R错误:缺少值不允许写在下面的作业的数据帧
通过二维顺序表实现杨辉三角
The core principles of electronic games
【LeetCode】593. 有效的正方形









