英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论