摘要:
自定义表名 type User struct{ Id int Name string } // 自定义表名 func (User) TableName() string { return "test_user" } 给默认表名加前缀或者后缀 gorm.DefaultTableNameHanlder 阅读全文
posted @ 2021-02-01 23:10
巫小诗
阅读(9453)
评论(0)
推荐(0)
摘要:
导包 import ( "fmt" "github.com/gin-gonic/gin" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" ) 连接数据库 db,err := gorm.Open("mysql","r 阅读全文
posted @ 2021-02-01 22:21
巫小诗
阅读(168)
评论(0)
推荐(0)

浙公网安备 33010602011771号