当前位置:网站首页>根据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)
}边栏推荐
- Vscode搭建ESP32-C3开发环境
- gdb调试常用概念整理
- app小程序开发的营销优势有什么?
- R Error in :missing values are not allowed in subscripted assignments of data frames
- 栈题目:标签验证器
- 【JS面试题】面试官问我:遍历一个数组用 for 和 forEach 哪个更快?
- Project Manager: Not bad!The SSO single sign-on code is written, and the sequence diagram is also drawn?
- 分布式事务方案
- The 10,000-character long article reveals the secrets of Huawei's data governance system!
- 用支持LaTex的Markdown语句编辑一个数学公式
猜你喜欢

在金融服务行业数字化转型中,低代码值得被关注

Super young!34-year-old professor, vice president of 985 Ace College!

【10点公开课】:快手GPU/FPGA/ASIC异构平台的应用探索

Redis-NoSql

Alibaba CTO Cheng Li: open source is the source of basic software!

【JS高级】js之闭包对象_04

IJCAI 2022 outstanding papers published, China won two draft in 298 the first author

human pose estimation-DEKR2021CVPR

即时通讯场景下安全合规的实践和经验

Vscode搭建ESP32-C3开发环境
随机推荐
hash table 实现代码
第二轮Okaleido Tiger热卖的背后,是背后生态机构战略支持
conda环境创建及复制
The most classic special effects scenes in 25 years
Legendary version adds npc modification, adds npc method and configuration parameter tutorial
十种实现延迟任务的方案
解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
性能优化竟白屏,难道真是我的锅?
Nine kinds of way, teach you to read the resources files in the directory path
线程池拒绝策略详解
C#实现线程管理类
【pytorch】1.6 tensor 基本运算
从KEIL仿真界面导出数据的技巧
一文搞懂JS的原型链
PytestFixture实战应用+Pytest.ini与conftest.py应用详解+Fixture及yield实现用例前置后置
1192. 奖金
trivy如何从非关系型数据库查询数据
【JS面试题】面试官问我:遍历一个数组用 for 和 forEach 哪个更快?
Still developing SMS verification code login?Try it (one-click login with your phone number)
Sqoop导入导出时数据内存溢出