英文:
Beego ORM with MySQL
问题
我对Beego和Go都是新手。我阅读了它的文档,但它将每个ORM操作都放在主包中,而不是模型包中。我不明白如何组织代码。我真的很困惑。
英文:
I am new to Beego as well as Go. I read its documentation but it puts every ORM operation in the main package instead of model package. I can't understand how to organize the code. I am really very confused.
答案1
得分: 2
你可以按照以下步骤自由操作,尝试构建你的第一个数据库程序。
- 构建[模型]
根据你的数据库表结构进行构建。 - 初始化ORM
- 创建一个ORM实例
- 根据你的需求进行CRUD操作
链接:
Beego/orm配置指南
https://beego.me/docs/mvc/model/orm.md
Beego/orm上进行CRUD操作的指南
https://beego.me/docs/mvc/model/object.md
英文:
You can feel free to follow steps as below, and try to build your first database program.
- Build [Models]
According to the table structure of your database. - Initialize the ORM
- New an ORM instance
- Operate CRUD as your want
Link:
Guidance for Beego/orm configuration
https://beego.me/docs/mvc/model/orm.md
Guidance for operating CRUD on Beego/orm
https://beego.me/docs/mvc/model/object.md
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论