Beego ORM与MySQL

huangapple go评论71阅读模式
英文:

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

你可以按照以下步骤自由操作,尝试构建你的第一个数据库程序。

  1. 构建[模型]
    根据你的数据库表结构进行构建。
  2. 初始化ORM
  3. 创建一个ORM实例
  4. 根据你的需求进行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.

  1. Build [Models]
    According to the table structure of your database.
  2. Initialize the ORM
  3. New an ORM instance
  4. 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

huangapple
  • 本文由 发表于 2017年3月30日 21:26:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/43119296.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定