Go数据库服务器API

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

Go Database Server API

问题

我在几个月前花了一些时间研究Go,并且对Go团队所做的所有设计决策都非常满意。

当时我的结论是,我需要官方支持SQL数据库(例如PgSql,MySql),才能采用它,否则采用这种语言是不可行的。

对于大公司来说,在IT实验上花费时间、精力和金钱是合理的,但对于小公司和个人来说,这可能是一场灾难,因为风险无法分散。

对我来说,使用没有Google支持的开源API似乎是不可行的。也许JDBC或ODBC是一个好的起点。

然而,最终性能将是关键,并且需要一个路线图。我如何使用带有Google支持的Sql-Server数据库API的Go语言?

如果没有对SQL数据库API的关键支持,除了用于云计算外,Go的未来是什么?

英文:

I spent some time looking at Go a few months ago and was certainly sold on all of the design decisions made by the Go team.

My conclusion then was that official support for a SQL database (eg. PgSql, MySql) was needed for me to adopt it and without that it was not feasible to adopt the language.

While it is logical for large corporations to expend time, effort and money on IT experiments, for small companies and individuals it can be a catastrophe because the risk is not spread.

It does not appear feasible to me to use an open-source API that does not have the backing of Google. Perhaps JDBC or ODBC would be a good start.

Eventually however, performance will be critical, and a roadmap warranted. How can I use Go with a Google-supported Sql-Server database API?

What is the future of Go without mission-critical support for an SQL database API, other than for cloud computing?

答案1

得分: 4

当前的Go语言每周版本中有一个内置的sql包。它仍然是实验性的,但展示了Go语言中数据库的计划。我猜实际的数据库驱动不应该被实现在标准库中,而是应该实现驱动接口。已经有一个PostgreSQL驱动在做这个,它的示例可以让你更好地了解期望的内容。

更新: 在下面的评论中给出的这个链接列出了四个实现了exp/sql/driver包的SQL驱动程序。它还包括一个链接到exp/sql包的设计目标

英文:

Current weekly versions of Go have a built-in sql package. It it still experimental, but shows the plan for databases in Go. I guess actual database drivers are not supposed to be implemented in the standard library, but should implement driver interface. There is already a PostgreSQL driver doing that, which with its examples gives you a better idea of what to expect.

UPDATE: This link given in the comment below lists four SQL drivers implementing exp/sql/driver package. It also includes a link to design goals of exp/sql package.

huangapple
  • 本文由 发表于 2011年12月11日 17:15:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/8462955.html
匿名

发表评论

匿名网友

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

确定