xorm/README_CN.md

80 lines
2.6 KiB
Markdown
Raw Normal View History

2013-05-16 06:12:27 +00:00
# xorm
2013-05-12 05:43:09 +00:00
[English](https://github.com/lunny/xorm/blob/master/README.md)
2013-05-03 07:32:52 +00:00
xorm是一个简单而强大的Go语言ORM库. 通过它可以使数据库操作非常简便。
2013-05-08 13:42:22 +00:00
2013-10-07 00:56:16 +00:00
[![Build Status](https://drone.io/github.com/lunny/xorm/status.png)](https://drone.io/github.com/lunny/xorm/latest) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/lunny/xorm)
2013-06-08 04:47:28 +00:00
2013-11-26 03:27:29 +00:00
## 特性
2013-09-24 17:31:25 +00:00
2013-11-26 03:27:29 +00:00
* 支持Struct和数据库表之间的灵活映射并支持自动同步
* 事务支持
* 同时支持原始SQL语句和ORM操作的混合执行
* 使用连写来简化调用
* 支持使用Id, In, Where, Limit, Join, Having, Table, Sql, Cols等函数和结构体等方式作为条件
* 支持级联加载Struct
* 支持缓存
* 支持根据数据库自动生成xorm的结构体
2013-09-11 08:30:17 +00:00
2013-05-16 06:12:27 +00:00
## 驱动支持
2013-05-08 13:42:22 +00:00
目前支持的Go数据库驱动如下
2013-05-03 07:32:52 +00:00
2013-10-18 12:41:30 +00:00
* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
2013-05-03 07:32:52 +00:00
* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/godrv)
2013-05-11 10:38:43 +00:00
* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
2013-11-06 07:43:30 +00:00
* Postgres: [github.com/lib/pq](https://github.com/lib/pq)
2013-09-11 09:28:27 +00:00
* Postgres: [github.com/bylevel/pq](https://github.com/bylevel/pq)
2013-05-11 10:38:43 +00:00
## 更新日志
2013-11-06 07:54:42 +00:00
* **v0.2.2** : Postgres驱动新增了对lib/pq的支持新增了逐条遍历方法Iterate新增了SetMaxConns(go1.2+)支持修复了bug若干
* **v0.2.1** : 新增数据库反转工具当前支持go和c++代码的生成,详见 [Xorm Tool README](https://github.com/lunny/xorm/blob/master/xorm/README.md); 修复了一些bug.
2013-09-29 09:51:49 +00:00
* **v0.2.0** : 新增 [缓存](https://github.com/lunny/xorm/blob/master/docs/QuickStart.md#120)支持查询速度提升3-5倍 新增数据库表和Struct同名的映射方式 新增Sync同步表结构
2013-11-26 03:27:29 +00:00
[更多更新日志...](https://github.com/lunny/xorm/blob/master/docs/ChangelogCN.md)
2013-05-03 07:32:52 +00:00
2013-05-08 13:42:22 +00:00
## 安装
go get github.com/lunny/xorm
2013-05-03 07:32:52 +00:00
2013-09-24 17:31:25 +00:00
## 文档
2013-05-08 13:42:22 +00:00
2013-09-30 00:50:56 +00:00
* [快速开始](https://github.com/lunny/xorm/blob/master/docs/QuickStart.md)
2013-05-11 10:38:43 +00:00
2013-09-24 17:31:25 +00:00
* [GoWalker代码文档](http://gowalker.org/github.com/lunny/xorm)
2013-11-26 03:27:29 +00:00
* [Godoc代码文档](http://godoc.org/github.com/lunny/xorm)
2013-09-24 17:31:25 +00:00
## 案例
2013-05-16 06:12:27 +00:00
2013-11-15 03:04:48 +00:00
* [Gowalker](http://gowalker.org) - [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker)
* [Sudo China](http://sudochina.com) - [github.com/insionng/toropress](http://github.com/insionng/toropress)
* [Godaily](http://godaily.org) - [github.com/govc/godaily](http://github.com/govc/godaily)
* [Very Hour](http://veryhour.com/)
2013-11-26 03:27:29 +00:00
## 讨论
2013-05-08 13:42:22 +00:00
2013-11-26 03:27:29 +00:00
请加入QQ群280360085 进行讨论。
2013-05-08 13:42:22 +00:00
2013-05-03 07:32:52 +00:00
## LICENSE
2013-05-11 13:27:36 +00:00
BSD License
[http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/)