Merging other languages

This commit is contained in:
James Miranda
2016-09-23 18:01:10 -03:00
parent 380a8ee74c
commit de3c5bdaa4
490 changed files with 24539 additions and 24588 deletions

View File

@@ -1,16 +1,13 @@
# 5 访问数据库
对许多Web应用程序而言数据库都是其核心所在。数据库几乎可以用来存储你想查询和修改的任何信息比如用户信息、产品目录或者新闻列表等。
Go没有内置的驱动支持任何的数据库但是Go定义了database/sql接口用户可以基于驱动接口开发相应数据库的驱动5.1小节里面介绍Go设计的一些驱动介绍Go是如何设计数据库驱动接口的。5.2至5.4小节介绍目前使用的比较多的一些关系型数据驱动以及如何使用5.5小节介绍我自己开发一个ORM库基于database/sql标准接口开发的可以兼容几乎所有支持database/sql的数据库驱动可以方便的使用Go style来进行数据库操作。
目前NOSQL已经成为Web开发的一个潮流很多应用采用了NOSQL作为数据库而不是以前的缓存5.6小节将介绍MongoDB和Redis两种NOSQL数据库。
>[Go database/sql tutorial](http://go-database-sql.org/) 里提供了惯用的范例及详细的说明。
## 目录
![](images/navi5.png?raw=true)
## links
* [目录](<preface.md>)
* 上一章: [第四章总结](<04.6.md>)
* 下一节: [database/sql接口](<05.1.md>)
# 5 Database
For web developers, the database is at the core of web development. You can save almost anything into a database and query or update data inside it, like user information, products or news articles.
Go doesn't provide any database drivers, but it does have a driver interface defined in the `database/sql` package. People can develop database drivers based on that interface. In section 5.1, we are going to talk about database driver interface design in Go; in sections 5.2 to 5.4, I will introduce some SQL database drivers to you; in section 5.5, i'll present the ORM that i've developed which is based on the `database/sql` interface standard. It's compatible with most drivers that have implemented the `database/sql` interface, and it makes it easy to access databases idiomatically in Go.
NoSQL has been a hot topic in recent years. More websites are deciding to use NoSQL databases as their main database instead of just for the purpose of caching. I will introduce you to two NoSQL databases, which are MongoDB and Redis, in section 5.6.
## Links
- [Directory](preface.md)
- Previous Chapter: [Chapter 4 Summary](04.6.md)
- Next section: [database/sql interface](05.1.md)