类似于Spring Data JPA的Golang框架

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

Framework similar to Spring Data JPA in Golang

问题

你好!你是否了解一些类似于Spring Data JPA的用Golang编写的框架?我正在寻找一些可以方便地在Golang结构体和MySQL数据库表之间进行操作的框架。我在Google上搜索了一下,但没有找到。谢谢!

英文:

Do you know some frameworks written in Golang similar to Spring Data JPA? I am looking for something which allow me to easy work between Golang structs and MySQL database tables. I was looking for it in Google, not found. Cheers.

答案1

得分: 5

GORM是Go语言中最受欢迎的ORM框架。然而,就功能而言,它与JPA或spring-data-jpa相比还远远不够强大。
在使用GORM时,你还需要处理许多注意事项,以确保能够得到一个好的解决方案。
虽然还有许多其他的ORM框架,但没有一个能够与spring-data-jpa媲美。

建议的解决方案将取决于你是否只需要简单的查询。如果你需要编写更复杂的查询,最好的方式是使用sqlx。

英文:

GORM is the most popular ORM for golang. However featurewise it is not even close to JPA or spring-data-jpa.
There are also many gotchas you will have to manage in order to produce a good solution using GORM.
There are many other ORMs, none coming close to spring-data-jpa.

The advised solution will depend on whether simple queries will be sufficient for you.
If you have to write more complex queries, the best way would be to use sqlx for that.

huangapple
  • 本文由 发表于 2017年5月30日 20:13:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/44261952.html
匿名

发表评论

匿名网友

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

确定