摘要: package main import ( "fmt" "gorm.io/driver/mysql" "gorm.io/gorm" "time" ) type User struct { ID int Name string CreatedTime time.Time } func main() { 阅读全文
posted @ 2021-06-04 00:15 青花メ 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 一、增 单:传入实例即可 user := &User{Name: "XX"} db.Create(user) 列表: users := []User{{Name: "xx"},{Name: "XX1"},{Name: "XX2"}} db.Create(&users) 字典 db.Model(&Us 阅读全文
posted @ 2021-06-04 00:11 青花メ 阅读(310) 评论(0) 推荐(0) 编辑