use gorm without str

时间2023-07-11 16:23:24 提问来自 华盛顿州Seattle 的网友 分类ChatGPT提问 浏览183 热度0
用GORM没有结构 GORM可以在没有使用struct的情况下使用。它允许你使用map[string]interface{}来表示你的数据库记录,而不必定义struct。例如: // Create a record with map[string]interface{} db.Create(&map[string]interface{}{ "name": "John Doe", "age": 20, })

AI智能问答网免责声明:
以上内容除特别注明外均来源于网友提问、ChatGPT回答,权益归原著者所有,本站仅作效果演示和欣赏之用;
若以上展示有冒犯或侵害到您,敬请联系我们进行删除处理,谢谢!

上一篇 Write a post in the 下一篇 搜索框的用法