Go 编程语言的 PostgreSQL 驱动程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11644914/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PostgreSQL driver for Go programming language
提问by deamon
http://go-lang.cat-v.org/pure-go-libslists two PosgreSQL drivers, but they haven't been updated since months and looking like one man shows. So I wonder if they are reliable / ready for production or if there are other recommended drivers.
http://go-lang.cat-v.org/pure-go-libs列出了两个 PosgreSQL 驱动程序,但它们已经几个月没有更新了,看起来就像一个人展示的那样。所以我想知道它们是否可靠/可以用于生产,或者是否有其他推荐的驱动程序。
Would you use Go with PostgreSQL for production and with what driver?
你会在生产中使用 Go 和 PostgreSQL 吗?使用什么驱动程序?
回答by dahc
In the year and a half since this question was asked, pqhas matured significantly and is actively maintained (multiple commits by multiple people in the last week, consistent weekly updates for the last several months).
自从提出这个问题以来的一年半时间里,pq已经显着成熟并得到积极维护(上周多人多次提交,最近几个月一致的每周更新)。
Docs are here: http://godoc.org/github.com/lib/pq
回答by Colin 't Hart
On this basis I probably wouldn't gofor it in production...
在此基础上,我可能不会去为它在生产...
The newest one seems to be https://github.com/jbarham/gopgsqldriver
最新的好像是https://github.com/jbarham/gopgsqldriver
But one of the advantages of open source is that you have all the source so you can maintain it yourself, contribute patches or even take over the maintainer's role.
但开源的优势之一是您拥有所有源代码,因此您可以自己维护、贡献补丁甚至接管维护者的角色。