谷歌Go数据存储接口

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

Google Go datastore interfaces

问题

你对go-pgsqlthrift4go有什么想法?

我想在一个项目中使用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.

huangapple
  • 本文由 发表于 2011年5月15日 09:57:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/6006015.html
匿名

发表评论

匿名网友

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

确定