摘要: package main import ( "database/sql" "gorm.io/driver/mysql" "gorm.io/gorm" ) // 1. 定义模型 type User struct { ID int64 // ID默认被当做主键 //Name *string `gorm: 阅读全文
posted @ 2021-11-07 18:53 专职 阅读(1995) 评论(0) 推荐(0) 编辑
摘要: 1. gorm操作mysql: 1.1 安装gorm gorm官网: https://gorm.io/zh_CN/docs/connecting_to_the_database.html gorm的github地址:https://github.com/go-gorm/gorm go get -u 阅读全文
posted @ 2021-11-07 17:10 专职 阅读(379) 评论(0) 推荐(0) 编辑