英文:
Google Go datastore interfaces
问题
我想在一个项目中使用Go语言和Postgres或Hypertable,但我想知道这些接口的成熟度和完整性如何。
英文:
What are your thoughts on go-pgsql and thrift4go?
I'd like to use Go with either Postgres or Hypertable for a project, but I'm curious as to how mature and complete these interfaces are.
答案1
得分: 2
我对go-psql
没有具体的经验,但由于没有答案,我会写下我的想法。
当前实现存在问题,可能会给你带来麻烦(例如,忽略低于秒的时间分辨率。如果你更新一个字段,但你的ORM
决定在查询中包含一个time
字段,会发生什么?)。
我看到的另一个问题是,不能保证这个项目会像你希望的那样得到维护。
另一种方法是构建一个非常简单的绑定到postgres
C接口,并直接使用它。在这种情况下,抽象并不是非常有用,但绝对不会有泄漏。而且可能足够了。
这就是Russ Cox(来自Go核心团队)最终为sqlite所做的事情。1
英文:
I don't have specific experience with go-psql
, but since there's no answer I'll write my thoughts.
There are issues with the current implementation, which might bite you (e.g. time resolution lower than seconds is ignored. What happens if you update a single field, but your ORM
decides to include a time
field within the query?).
Other problem that I see is, there's no promise this project will be maintained as long as you wish.
Another approach is to build a very simple binding to the postgres
C interface, and just use it. In that case, the abstraction is not very helpful, but definitely not leaky. And it might be enough.
That's what Russ Cox (from the core Go (golang) team) ended up doing for sqlite.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论