From 6bc97aa3455792e5b9e82dc8aa69cf517abf77fd Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 11 Sep 2014 18:03:03 +0800 Subject: [PATCH] improved docs struct --- docs/LICENSE | 27 ++ docs/README.md | 19 + docs/en-US/about.md | 27 ++ docs/en-US/donate.md | 38 ++ docs/{ => en-US/intro}/AutoMap.md | 0 docs/{ => en-US/intro}/COLUMNTYPE.md | 0 docs/en-US/intro/README.md | 143 ++++++ docs/en-US/intro/cases.md | 12 + .../intro/changelog.md} | 6 + docs/en-US/intro/faq.md | 51 ++ .../intro/quick_start.md} | 83 +--- docs/en-US/intro/tools.md | 109 +++++ docs/en-US/team.md | 22 + docs/{ => images}/cache_design.graffle | 0 docs/{ => images}/cache_design.png | Bin docs/zh-CN/about.md | 27 ++ docs/zh-CN/donate.md | 44 ++ docs/zh-CN/intro/AutoMap.md | 65 +++ docs/zh-CN/intro/COLUMNTYPE.md | 438 ++++++++++++++++++ docs/zh-CN/intro/README.md | 143 ++++++ docs/zh-CN/intro/cases.md | 13 + .../intro/change_log.md} | 5 + docs/zh-CN/intro/faq.md | 74 +++ .../intro/quick_start.md} | 106 +---- docs/zh-CN/intro/tools.md | 109 +++++ docs/zh-CN/team.md | 22 + 26 files changed, 1409 insertions(+), 174 deletions(-) create mode 100644 docs/LICENSE create mode 100644 docs/README.md create mode 100644 docs/en-US/about.md create mode 100644 docs/en-US/donate.md rename docs/{ => en-US/intro}/AutoMap.md (100%) rename docs/{ => en-US/intro}/COLUMNTYPE.md (100%) create mode 100644 docs/en-US/intro/README.md create mode 100644 docs/en-US/intro/cases.md rename docs/{Changelog.md => en-US/intro/changelog.md} (98%) create mode 100644 docs/en-US/intro/faq.md rename docs/{QuickStart.md => en-US/intro/quick_start.md} (89%) create mode 100644 docs/en-US/intro/tools.md create mode 100644 docs/en-US/team.md rename docs/{ => images}/cache_design.graffle (100%) rename docs/{ => images}/cache_design.png (100%) create mode 100644 docs/zh-CN/about.md create mode 100644 docs/zh-CN/donate.md create mode 100644 docs/zh-CN/intro/AutoMap.md create mode 100644 docs/zh-CN/intro/COLUMNTYPE.md create mode 100644 docs/zh-CN/intro/README.md create mode 100644 docs/zh-CN/intro/cases.md rename docs/{ChangelogCN.md => zh-CN/intro/change_log.md} (99%) create mode 100644 docs/zh-CN/intro/faq.md rename docs/{QuickStartCN.md => zh-CN/intro/quick_start.md} (88%) create mode 100644 docs/zh-CN/intro/tools.md create mode 100644 docs/zh-CN/team.md diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 00000000..9ac0c261 --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013 - 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..db6d7fe2 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,19 @@ +# What is this? + +An open source project for Xorm documentation. + +## How to contribute? + +Fork, update and submit a pull request. No matter how big or small, your changes are welcome! + +## How does it work? + +Xorm Web server checks for updates to this folder and updates the main documentation automatically. + +## Note + +Xorm documentation is written using standard markdown syntax. Please submit your changes using the same syntax. + +## License + +This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. \ No newline at end of file diff --git a/docs/en-US/about.md b/docs/en-US/about.md new file mode 100644 index 00000000..275314f9 --- /dev/null +++ b/docs/en-US/about.md @@ -0,0 +1,27 @@ +# About + +This manual documents aspects of Xorm. + +### New to Xorm? + +Read about the [Quick Start](docs/intro/quick_start.md). + +### Can't find what you're looking for? + +Search our [mailing list (xorm@googlegroups.com)](https://groups.google.com/forum/#!forum/xorm). + +### Need help? + +Send an email to the [xorm@googlegroups.com](mailto:xorm@googlegroups.com). + +### Find a bug? + +Open an [issue on github](https://github.com/go-xorm/xorm/issues). + +### Want to be a contributor? + +Fork the [documentation project](https://github.com/go-xorm/xorm/tree/master/docs), edit and pull request. + +### Source code of this website? + +Please visit [Xorm Web](https://github.com/go-xorm/website). \ No newline at end of file diff --git a/docs/en-US/donate.md b/docs/en-US/donate.md new file mode 100644 index 00000000..b6a278ef --- /dev/null +++ b/docs/en-US/donate.md @@ -0,0 +1,38 @@ +# Donation + +

+ We will continue hard working with your huge support! +

+ +

+ Donate by Paypal: +

+ +

+

+ +### Your donation will be used as: + +- Supports the development of Beego +- Supports maintaining the communities +- Upgrade to better server +- Award the outstanding contributors +- Holds community activities and lectures + +### Donation Lists (descending by donating time) + +| Donated at | Donator | Amount | Contact | Comments | +| ---------------- |:---------:| --------:|:---------:| ----------------------- | +|2014-7-8 | Steven Wang | 100¥ | easykooc@gmail.com | xorm目前做得最好的orm for golang | +|2014-7-8 | 韩天峰 | 20¥ | apolov@vip.qq.com | xorm是Golang里最好用的DB库 | +|2014-7-8 | sunhongjian | 100¥ | shongjiang@gmail.com |支持开源,支持美好的事物! | +|2014-7-8 | Jimmy Kuu | 200¥ | jimmy.kuu@gmail.com |再接再厉,持续发展 | +|2014-7-8 | 张仲东 | 100¥ | GoCMS作者 |支持XORM!! | +|2014-7-8 | wangwei | 100¥ | iamjcww@gmail.com |鄙视楼下 | +|2014-7-8 | Jazz | 2¥ | 1002376560@qq.com |这个沙发必须抢 | \ No newline at end of file diff --git a/docs/AutoMap.md b/docs/en-US/intro/AutoMap.md similarity index 100% rename from docs/AutoMap.md rename to docs/en-US/intro/AutoMap.md diff --git a/docs/COLUMNTYPE.md b/docs/en-US/intro/COLUMNTYPE.md similarity index 100% rename from docs/COLUMNTYPE.md rename to docs/en-US/intro/COLUMNTYPE.md diff --git a/docs/en-US/intro/README.md b/docs/en-US/intro/README.md new file mode 100644 index 00000000..bcd0bc36 --- /dev/null +++ b/docs/en-US/intro/README.md @@ -0,0 +1,143 @@ +--- +root: true +name: Introduction +sort: 0 +--- + +[中文](https://github.com/go-xorm/xorm/blob/master/README_CN.md) + +Xorm is a simple and powerful ORM for Go. + +[![Build Status](https://drone.io/github.com/go-xorm/tests/status.png)](https://drone.io/github.com/go-xorm/tests/latest) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/go-xorm/xorm) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lunny/xorm/trend.png)](https://bitdeli.com/free "Bitdeli Badge") + +# Features + +* Struct <-> Table Mapping Support + +* Chainable APIs + +* Transaction Support + +* Both ORM and raw SQL operation Support + +* Sync database schema Support + +* Query Cache speed up + +* Database Reverse support, See [Xorm Tool README](https://github.com/go-xorm/cmd/blob/master/README.md) + +* Simple cascade loading support + +* Optimistic Locking support + + +# Drivers Support + +Drivers for Go's sql package which currently support database/sql includes: + +* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + +* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/godrv) + +* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + +* Postgres: [github.com/lib/pq](https://github.com/lib/pq) + +* MsSql: [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) + +* MsSql: [github.com/lunny/godbc](https://github.com/lunny/godbc) + + + +# Changelog + +* **v0.4.0 RC1** + Changes: + * moved xorm cmd to [github.com/go-xorm/cmd](github.com/go-xorm/cmd) + * refactored general DB operation a core lib at [github.com/go-xorm/core](https://github.com/go-xorm/core) + * moved tests to github.com/go-xorm/tests [github.com/go-xorm/tests](github.com/go-xorm/tests) + + Improvements: + * Prepared statement cache + * Add Incr API + * Specify Timezone Location + +* **v0.3.2** + Improvements: + * Add AllCols & MustCols function + * Add TableName for custom table name + + Bug Fixes: + * #46 + * #51 + * #53 + * #89 + * #86 + * #92 + +* **v0.3.1** + + Features: + * Support MSSQL DB via ODBC driver ([github.com/lunny/godbc](https://github.com/lunny/godbc)); + * Composite Key, using multiple pk xorm tag + * Added Row() API as alternative to Iterate() API for traversing result set, provide similar usages to sql.Rows type + * ORM struct allowed declaration of pointer builtin type as members to allow null DB fields + * Before and After Event processors + + Improvements: + * Allowed int/int32/int64/uint/uint32/uint64/string as Primary Key type + * Performance improvement for Get()/Find()/Iterate() + +[More changelogs ...](https://github.com/go-xorm/xorm/blob/master/docs/Changelog.md) + +# Installation + +If you have [gopm](https://github.com/gpmgo/gopm) installed, + + gopm get github.com/go-xorm/xorm + +Or + + go get github.com/go-xorm/xorm + +# Documents + +* [GoDoc](http://godoc.org/github.com/go-xorm/xorm) + +* [GoWalker](http://gowalker.org/github.com/go-xorm/xorm) + +* [Quick Start](https://github.com/go-xorm/xorm/blob/master/docs/QuickStart.md) + +# Cases + +* [Gorevel](http://http://gorevel.cn/) - [github.com/goofcc/gorevel](http://github.com/goofcc/gorevel) + +* [Gogs](http://try.gogits.org) - [github.com/gogits/gogs](http://github.com/gogits/gogs) + +* [Gowalker](http://gowalker.org) - [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) + +* [Gobuild.io](http://gobuild.io) - [github.com/shxsun/gobuild](http://github.com/shxsun/gobuild) + +* [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/) + +* [GoCMS - github.com/zzboy/GoCMS](https://github.com/zzdboy/GoCMS) + +* [GoBBS - gobbs.domolo.com](http://gobbs.domolo.com/) + + +# Discuss + +Please visit [Xorm on Google Groups](https://groups.google.com/forum/#!forum/xorm) + +# Contributing + +If you want to pull request, please see [CONTRIBUTING](https://github.com/go-xorm/xorm/blob/master/CONTRIBUTING.md) + +# LICENSE + + BSD License + [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) diff --git a/docs/en-US/intro/cases.md b/docs/en-US/intro/cases.md new file mode 100644 index 00000000..5d27f3c5 --- /dev/null +++ b/docs/en-US/intro/cases.md @@ -0,0 +1,12 @@ +--- +name: Cases +sort: 90 +--- + +* [Gowalker](http://gowalker.org),source [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) + +* [GoDaily](http://godaily.org),source [github.com/govc/godaily](http://github.com/govc/godaily) + +* [Sudochina](http://sudochina.com) source [github.com/insionng/toropress](http://github.com/insionng/toropress) + +* [VeryHour](http://veryhour.com) \ No newline at end of file diff --git a/docs/Changelog.md b/docs/en-US/intro/changelog.md similarity index 98% rename from docs/Changelog.md rename to docs/en-US/intro/changelog.md index fb9b1ec3..3aa3c16b 100644 --- a/docs/Changelog.md +++ b/docs/en-US/intro/changelog.md @@ -1,3 +1,8 @@ +--- +name: Changelog +sort: 1 +--- + ## Changelog * **v0.4.0 RC1** @@ -52,3 +57,4 @@ * **v0.1.2** : Insert function now supports both struct and slice pointer parameters, batch inserting and auto transaction * **v0.1.1** : Add Id, In functions and improved README * **v0.1.0** : Initial release. + diff --git a/docs/en-US/intro/faq.md b/docs/en-US/intro/faq.md new file mode 100644 index 00000000..fee08ddf --- /dev/null +++ b/docs/en-US/intro/faq.md @@ -0,0 +1,51 @@ +--- +name: FAQ +sort: 100 +--- + +* How the xorm tag use both with json? + + Use space. + +```Go +type User struct { + Name string `json:"name" xorm:"name"` +} +``` + +* Does xorm support composite primary key? + + Yes. You can use pk tag. All fields have tag will as one primary key by fields order on struct. When use, you can use xorm.PK{1, 2}. For example: `Id(xorm.PK{1, 2})`. + +* How to use join? + + We can use Join() and extends tag to do join operation. For example: + + type Userinfo struct { + Id int64 + Name string + DetailId int64 + } + + type Userdetail struct { + Id int64 + Gender int + } + + type User struct { + Userinfo `xorm:"extends"` + Userdetail `xorm:"extends"` + } + + var users = make([]User, 0) + err := engine.Table(&Userinfo{}).Join("LEFT", "userdetail", "userinfo.detail_id = userdetail.id").Find(&users) + + //assert(User.Userinfo.Id != 0 && User.Userdetail.Id != 0) + +Please notice that Userinfo field on User should be before Userdetail because of the order on join SQL stsatement. If the order is wrong, the same name field may be set a wrong value. + +Of course, If join statment is very long, you could directly use Sql(): + + err := engine.Sql("select * from userinfo, userdetail where userinfo.detail_id = userdetail.id").Find(&users) + + //assert(User.Userinfo.Id != 0 && User.Userdetail.Id != 0) \ No newline at end of file diff --git a/docs/QuickStart.md b/docs/en-US/intro/quick_start.md similarity index 89% rename from docs/QuickStart.md rename to docs/en-US/intro/quick_start.md index a363fdf2..b8ffe69c 100644 --- a/docs/QuickStart.md +++ b/docs/en-US/intro/quick_start.md @@ -1,3 +1,8 @@ +--- +name: Quick Start +sort: 2 +--- + Quick Start ===== @@ -26,12 +31,7 @@ Quick Start * [9.Execute SQL query](#100) * [10.Transaction](#110) * [11.Cache](#120) -* [12.Xorm Tool](#130) - * [12.1.Reverse command](#131) * [13.Examples](#140) -* [14.Cases](#150) -* [15.FAQ](#160) -* [16.Discuss](#170) ## 1.Create ORM Engine @@ -54,7 +54,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/go-xorm/xorm" ) -engine, err := xorm.NewEngine("sqlite3", "./test.db") +engine, err = xorm.NewEngine("sqlite3", "./test.db") defer engine.Close() ``` @@ -346,6 +346,7 @@ Notice: If you want to use transaction on inserting, you should use session.Begi ### 5.1. Chainable APIs for Queries, Execusions and Aggregations Queries and Aggregations is basically formed by using `Get`, `Find`, `Count` methods, with conjunction of following chainable APIs to form conditions, grouping and ordering: +查询和统计主要使用`Get`, `Find`, `Count`三个方法。在进行查询时可以使用多个方法来形成查询条件,条件函数如下: * Id([]interface{}) Primary Key lookup @@ -537,12 +538,13 @@ affected, err := engine.Table(new(User)).Id(id).Update(map[string]interface{}{"a ### 6.1.Optimistic Lock To enable object optimistic lock, add 'version' tag value: +```Go type User struct { Id int64 Name string Version int `xorm:"version"` } - +``` The version starts with 1 when inserted to DB. For updating make sure originated version value is used for optimistic lock check. ```Go @@ -666,75 +668,8 @@ Cache implement theory below: ![cache design](https://raw.github.com/go-xorm/xorm/master/docs/cache_design.png) - -## 12.xorm tool -xorm commandl line tool - -### 12.1.Reverse command -Please visit [xorm tool](https://github.com/go-xorm/cmd) - ## 13.Examples Please visit [https://github.com/go-xorm/xorm/tree/master/examples](https://github.com/go-xorm/xorm/tree/master/examples) - -## 14.Cases - -* [Gowalker](http://gowalker.org),source [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) - -* [GoDaily](http://godaily.org),source [github.com/govc/godaily](http://github.com/govc/godaily) - -* [Sudochina](http://sudochina.com) source [github.com/insionng/toropress](http://github.com/insionng/toropress) - -* [VeryHour](http://veryhour.com) - - -## 15.FAQ - -* How the xorm tag use both with json? - - Use space. - -```Go -type User struct { - Name string `json:"name" xorm:"name"` -} -``` - -* Does xorm support composite primary key? - - Yes. You can use pk tag. All fields have tag will as one primary key by fields order on struct. When use, you can use xorm.PK{1, 2}. For example: `Id(xorm.PK{1, 2})`. - -* How to use join? - - We can use Join() and extends tag to do join operation. For example: - - type Userinfo struct { - Id int64 - Name string - DetailId int64 - } - - type Userdetail struct { - Id int64 - Gender int - } - - type User struct { - Userinfo `xorm:"extends"` - Userdetail `xorm:"extends"` - } - - var users = make([]User, 0) - err := engine.Table(&Userinfo{}).Join("LEFT", "userdetail", "userinfo.detail_id = userdetail.id").Find(&users) - - //assert(User.Userinfo.Id != 0 && User.Userdetail.Id != 0) - -Please notice that Userinfo field on User should be before Userdetail because of the order on join SQL stsatement. If the order is wrong, the same name field may be set a wrong value. - -Of course, If join statment is very long, you could directly use Sql(): - - err := engine.Sql("select * from userinfo, userdetail where userinfo.detail_id = userdetail.id").Find(&users) - - //assert(User.Userinfo.Id != 0 && User.Userdetail.Id != 0) diff --git a/docs/en-US/intro/tools.md b/docs/en-US/intro/tools.md new file mode 100644 index 00000000..218360f5 --- /dev/null +++ b/docs/en-US/intro/tools.md @@ -0,0 +1,109 @@ +--- +root: false +name: Xorm Tools +sort: 3 +--- + +# xorm tools + +xorm tools is a set of tools for database operation. + +## Binary Install + +If you have [got](https://github.com/gobuild/got) installed, you can install by got + +``` +got go-xorm/cmd/xorm +``` + +or you can download from [gobuild](http://gobuild.io/download/github.com/lunny/got). + +## Source Install + +`go get github.com/go-xorm/cmd/xorm` + +and you should install the depends below: + +* github.com/go-xorm/xorm + +* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + +* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/godrv) + +* Postgres: [github.com/lib/pq](https://github.com/lib/pq) + +* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + +** For sqlite support, you need build via `go build -tags sqlite3` because of this driver ask cgo. + +## Commands + +All the commands below. + +* **reverse** reverse a db to codes +* **shell** a general shell to operate all kinds of database +* **dump** dump database all table struct's and data to standard output +* **source** execute a sql from std in +* **driver** list all supported drivers + +## Reverse + +Reverse command is a tool to convert your database struct to all kinds languages of structs or classes. After you installed the tool, you can type + +`xorm help reverse` + +to get help + +example: + +sqlite: +`xorm reverse sqite3 test.db templates/goxorm` + +mysql: +`xorm reverse mysql root:@/xorm_test?charset=utf8 templates/goxorm` + +mymysql: +`xorm reverse mymysql xorm_test2/root/ templates/goxorm` + +postgres: +`xorm reverse postgres "dbname=xorm_test sslmode=disable" templates/goxorm` + +will generated go files in `./model` directory + +### Template and Config + +Now, xorm tool supports go and c++ two languages and have go, goxorm, c++ three of default templates. In template directory, we can put a config file to control how to generating. + +```` +lang=go +genJson=1 +``` + +lang must be go or c++ now. +genJson can be 1 or 0, if 1 then the struct will have json tag. + +## Shell + +Shell command provides a tool to operate database. For example, you can create table, alter table, insert data, delete data and etc. + +`xorm shell sqlite3 test.db` will connect to the sqlite3 database and you can type `help` to list all the shell commands. + +## Dump + +Dump command provides a tool to dump all database structs and data as SQL to your standard output. + +`xorm dump sqlite3 test.db` could dump sqlite3 database test.db to standard output. If you want to save to file, just +type `xorm dump sqlite3 test.db > test.sql`. + +## Source + +`xorm source sqlite3 test.db < test.sql` will execute sql file on the test.db. + +## Driver + +List all supported drivers since default build will not include sqlite3. + +## LICENSE + + BSD License + [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) diff --git a/docs/en-US/team.md b/docs/en-US/team.md new file mode 100644 index 00000000..0b6ca359 --- /dev/null +++ b/docs/en-US/team.md @@ -0,0 +1,22 @@ +# Developer Team + +### Unknown + +- Team role: Project manager, back-end developer. +- Social network: [Sina Weibo](http://weibo.com/Obahua) [GitHub](https://github.com/Unknwon) [Twitter](https://twitter.com/joe2010xtmf) [Google+](https://plus.google.com/u/0/+JiahuaChen) + +### Lunny + +- Team role: Back-end Git and database developer. +- Social network: [Sina Weibo](http://weibo.com/xiaolunwen) [GitHub](https://github.com/lunny) [Twitter](https://twitter.com/lunny) + +### Fuxiaohei + +- Team role: Front-end developer. +- Social network: [Sina Weibo](http://weibo.com/fuxiaohei) [GitHub](https://github.com/fuxiaohei) + + +### Slene + +- Team role: Front and back-end developer. +- Social network: [Sina Weibo](http://weibo.com/slene) [GitHub](https://github.com/slene) [Twitter](https://twitter.com/slene) \ No newline at end of file diff --git a/docs/cache_design.graffle b/docs/images/cache_design.graffle similarity index 100% rename from docs/cache_design.graffle rename to docs/images/cache_design.graffle diff --git a/docs/cache_design.png b/docs/images/cache_design.png similarity index 100% rename from docs/cache_design.png rename to docs/images/cache_design.png diff --git a/docs/zh-CN/about.md b/docs/zh-CN/about.md new file mode 100644 index 00000000..6b0cf9f8 --- /dev/null +++ b/docs/zh-CN/about.md @@ -0,0 +1,27 @@ +# 关于 + +本网站文档页面详细描述了 Xorm 的各个方面。 + +### 新手指导 + +如果您是首次了解 Xorm,我们建议您先阅读 [快速入门](docs/intro/quick_start.md)。 + +### 其它资源 + +如果您无法找到相关问题的满意答案,可以在 [邮件列表 (xorm@googlegroups.com)](https://groups.google.com/forum/#!search/xorm) 中搜索。 + +### 寻求帮助 + +如果您遇到无法解决的问题,可以发送邮件到 [xorm@googlegroups.com](mailto:xorm@googlegroups.com) 提问。 + +### 问题提交 + +如果您在使用过程中发现 Xorm 有潜在的问题,请通过 [Xorm](https://github.com/go-xorm/xorm/issues) 上的问题列表提交。 + +### 完善文档 + +您可以通过派生 [文档项目](https://github.com/go-xorm/xorm/tree/master/docs)、编辑,然后提交合并请求。 + +### 网站源码 + +请移步 [Xorm Web](https://github.com/go-xorm/website)。 \ No newline at end of file diff --git a/docs/zh-CN/donate.md b/docs/zh-CN/donate.md new file mode 100644 index 00000000..998ac6cf --- /dev/null +++ b/docs/zh-CN/donate.md @@ -0,0 +1,44 @@ +# 捐赠我们 + +

+ 在您的支持与鼓励下,Xorm 开发团队将会更加努力地开发出更好的产品! +

+ +

+ 支付宝捐赠: +

+ + + +

+ Paypal 捐赠 +

+ +

+

+ +### 您的捐赠将被用于: + +- 持续和深入的开发 +- 维护社区的运行稳定 +- 租用更好的带宽 +- 奖励团队的杰出贡献者 +- 社区活动或讲座 + +### 捐赠列表(按照捐赠时间倒序) + +| 捐赠时间 | 捐赠人 | 金额 | 联系方式 | 附言 | +| ---------------- |:---------:| --------:|:---------:| ----------------------- | +|2014-7-8 | Steven Wang | 100¥ | easykooc@gmail.com | xorm目前做得最好的orm for golang | +|2014-7-8 | 韩天峰 | 20¥ | apolov@vip.qq.com | xorm是Golang里最好用的DB库 | +|2014-7-8 | sunhongjian | 100¥ | shongjiang@gmail.com |支持开源,支持美好的事物! | +|2014-7-8 | Jimmy Kuu | 200¥ | jimmy.kuu@gmail.com |再接再厉,持续发展 | +|2014-7-8 | 张仲东 | 100¥ | GoCMS作者 |支持XORM!! | +|2014-7-8 | wangwei | 100¥ | iamjcww@gmail.com |鄙视楼下 | +|2014-7-8 | Jazz | 2¥ | 1002376560@qq.com |这个沙发必须抢 | diff --git a/docs/zh-CN/intro/AutoMap.md b/docs/zh-CN/intro/AutoMap.md new file mode 100644 index 00000000..cae66209 --- /dev/null +++ b/docs/zh-CN/intro/AutoMap.md @@ -0,0 +1,65 @@ +When a struct auto mapping to a database's table, the below table describes how they change to each other: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
go type's kind + value methodxorm type +
implemented ConversionConversion.ToDB / Conversion.FromDBText
int, int8, int16, int32, uint, uint8, uint16, uint32 Int
int64, uint64BigInt
float32Float
float64Double
complex64, complex128json.Marshal / json.UnMarshalVarchar(64)
[]uint8Blob
array, slice, map except []uint8json.Marshal / json.UnMarshalText
bool1 or 0Bool
stringVarchar(255)
time.TimeDateTime
cascade structprimary key field valueBigInt
structjson.Marshal / json.UnMarshalText
+ Others + + Text +
\ No newline at end of file diff --git a/docs/zh-CN/intro/COLUMNTYPE.md b/docs/zh-CN/intro/COLUMNTYPE.md new file mode 100644 index 00000000..d5a7e85a --- /dev/null +++ b/docs/zh-CN/intro/COLUMNTYPE.md @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
xorm + mysql + sqlite3 + postgres + remark
BIT + BIT + INTEGER + BIT +
TINYINT + TINYINT + INTEGER + SMALLINT +
SMALLINT + SMALLINT + INTEGER + SMALLINT +
MEDIUMINT + MEDIUMINT + INTEGER + INTEGER +
INT + INT + INTEGER + INTEGER +
INTEGER + INTEGER + INTEGER + INTEGER +
BIGINT + BIGINT + INTEGER + BIGINT +
CHAR + CHAR + TEXT + CHAR +
VARCHAR + VARCHAR + TEXT + VARCHAR +
TINYTEXT + TINYTEXT + TEXT + TEXT +
TEXT + TEXT + TEXT + TEXT +
MEDIUMTEXT + MEDIUMTEXT + TEXT + TEXT +
LONGTEXT + LONGTEXT + TEXT + TEXT +
BINARY + BINARY + BLOB + BYTEA +
VARBINARY + VARBINARY + BLOB + BYTEA +
DATE + DATE + NUMERIC + DATE +
DATETIME + DATETIME + NUMERIC + TIMESTAMP +
TIME + TIME + NUMERIC + TIME +
TIMESTAMP + TIMESTAMP + NUMERIC + TIMESTAMP +
TIMESTAMPZ + TEXT + TEXT + TIMESTAMP with zone + timestamp with zone info
REAL + REAL + REAL + REAL +
FLOAT + FLOAT + REAL + REAL +
DOUBLE + DOUBLE + REAL + DOUBLE PRECISION +
DECIMAL + DECIMAL + NUMERIC + DECIMAL +
NUMERIC + NUMERIC + NUMERIC + NUMERIC +
TINYBLOB + TINYBLOB + BLOB + BYTEA +
BLOB + BLOB + BLOB + BYTEA +
MEDIUMBLOB + MEDIUMBLOB + BLOB + BYTEA +
LONGBLOB + LONGBLOB + BLOB + BYTEA +
BYTEA + BLOB + BLOB + BYTEA +
BOOL + TINYINT + INTEGER + BOOLEAN +
SERIAL + INT + INTEGER + SERIAL + auto increment
BIGSERIAL + BIGINT + INTEGER + BIGSERIAL + auto increment
\ No newline at end of file diff --git a/docs/zh-CN/intro/README.md b/docs/zh-CN/intro/README.md new file mode 100644 index 00000000..2a5ac546 --- /dev/null +++ b/docs/zh-CN/intro/README.md @@ -0,0 +1,143 @@ +--- +root: true +name: 简介 +sort: 0 +--- + +# xorm + +[English](https://github.com/go-xorm/xorm/blob/master/README.md) + +xorm是一个简单而强大的Go语言ORM库. 通过它可以使数据库操作非常简便。 + +[![Build Status](https://drone.io/github.com/go-xorm/tests/status.png)](https://drone.io/github.com/go-xorm/tests/latest) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/go-xorm/xorm) + +## 特性 + +* 支持Struct和数据库表之间的灵活映射,并支持自动同步 + +* 事务支持 + +* 同时支持原始SQL语句和ORM操作的混合执行 + +* 使用连写来简化调用 + +* 支持使用Id, In, Where, Limit, Join, Having, Table, Sql, Cols等函数和结构体等方式作为条件 + +* 支持级联加载Struct + +* 支持缓存 + +* 支持根据数据库自动生成xorm的结构体 + +* 支持记录版本(即乐观锁) + +## 驱动支持 + +目前支持的Go数据库驱动和对应的数据库如下: + +* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + +* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/godrv) + +* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + +* Postgres: [github.com/lib/pq](https://github.com/lib/pq) + +* MsSql: [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) + +* MsSql: [github.com/lunny/godbc](https://github.com/lunny/godbc) + +## 更新日志 + +* **v0.4.0 RC1** + 新特性: + * 移动xorm cmd [github.com/go-xorm/cmd](github.com/go-xorm/cmd) + * 在重构一般DB操作核心库 [github.com/go-xorm/core](https://github.com/go-xorm/core) + * 移动测试github.com/复XORM/测试 [github.com/go-xorm/tests](github.com/go-xorm/tests) + + 改进: + * Prepared statement 缓存 + * 添加 Incr API + * 指定时区位置 + +* **v0.3.2** + 新特性: + * Add AllCols & MustCols function + * Add TableName for custom table name + + Bug 修复: + * #46 + * #51 + * #53 + * #89 + * #86 + * #92 + +* **v0.3.1** + + 新特性: + * 支持 MSSQL DB 通过 ODBC 驱动 ([github.com/lunny/godbc](https://github.com/lunny/godbc)); + * 通过多个pk标记支持联合主键; + * 新增 Rows() API 用来遍历查询结果,该函数提供了类似sql.Rows的相似用法,可作为 Iterate() API 的可选替代; + * ORM 结构体现在允许内建类型的指针作为成员,使得数据库为null成为可能; + * Before 和 After 支持 + + 改进: + * 允许 int/int32/int64/uint/uint32/uint64/string 作为主键类型 + * 查询函数 Get()/Find()/Iterate() 在性能上的改进 + + +[更多更新日志...](https://github.com/go-xorm/xorm/blob/master/docs/ChangelogCN.md) + +## 安装 + +推荐使用 [gopm](https://github.com/gpmgo/gopm) 进行安装: + + gopm get github.com/go-xorm/xorm + +或者您也可以使用go工具进行安装: + + go get github.com/go-xorm/xorm + +## 文档 + +* [快速开始](https://github.com/go-xorm/xorm/blob/master/docs/QuickStartCN.md) + +* [GoWalker代码文档](http://gowalker.org/github.com/go-xorm/xorm) + +* [Godoc代码文档](http://godoc.org/github.com/go-xorm/xorm) + + +## 案例 + +* [Gogs](http://try.gogits.org) - [github.com/gogits/gogs](http://github.com/gogits/gogs) + +* [Gowalker](http://gowalker.org) - [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) + +* [Gobuild.io](http://gobuild.io) - [github.com/shxsun/gobuild](http://github.com/shxsun/gobuild) + +* [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/) + +* [GoCMS - github.com/zzboy/GoCMS](https://github.com/zzdboy/GoCMS) + +* [GoBBS - gobbs.domolo.com](http://gobbs.domolo.com/) + + +## 讨论 + +请加入QQ群:280360085 进行讨论。 + +## 贡献 + +如果您也想为Xorm贡献您的力量,请查看 [CONTRIBUTING](https://github.com/go-xorm/xorm/blob/master/CONTRIBUTING.md) + +## LICENSE + +BSD License +[http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) + diff --git a/docs/zh-CN/intro/cases.md b/docs/zh-CN/intro/cases.md new file mode 100644 index 00000000..bc8f552a --- /dev/null +++ b/docs/zh-CN/intro/cases.md @@ -0,0 +1,13 @@ +--- +name: 案例 +sort: 90 +--- + +* [Gowalker](http://gowalker.org),源代码 [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) + +* [GoDaily Go语言学习网站](http://godaily.org),源代码 [github.com/govc/godaily](http://github.com/govc/godaily) + +* [Sudochina](http://sudochina.com) 和对应的源代码[github.com/insionng/toropress](http://github.com/insionng/toropress) + +* [VeryHour](http://veryhour.com) + diff --git a/docs/ChangelogCN.md b/docs/zh-CN/intro/change_log.md similarity index 99% rename from docs/ChangelogCN.md rename to docs/zh-CN/intro/change_log.md index 246fa35d..a05af487 100644 --- a/docs/ChangelogCN.md +++ b/docs/zh-CN/intro/change_log.md @@ -1,3 +1,8 @@ +--- +name: 变更日志 +sort: 1 +--- + ## 更新日志 * **v0.4.0 RC1** diff --git a/docs/zh-CN/intro/faq.md b/docs/zh-CN/intro/faq.md new file mode 100644 index 00000000..389cde8d --- /dev/null +++ b/docs/zh-CN/intro/faq.md @@ -0,0 +1,74 @@ +--- +name: FAQ +sort: 100 +--- + +* 怎么同时使用xorm的tag和json的tag? + +答:使用空格 + +```Go +type User struct { + Name string `json:"name" xorm:"name"` +} +``` + +* 我的struct里面包含bool类型,为什么它不能作为条件也没法用Update更新? + +答:默认bool类型因为无法判断是否为空,所以不会自动作为条件也不会作为Update的内容。可以使用UseBool函数,也可以使用Cols函数 + +```Go +engine.Cols("bool_field").Update(&Struct{BoolField:true}) +// UPDATE struct SET bool_field = true +``` + +* 我的struct里面包含float64和float32类型,为什么用他们作为查询条件总是不正确? + +答:默认float32和float64映射到数据库中为float,real,double这几种类型,这几种数据库类型数据库的实现一般都是非精确的。因此作为相等条件查询有可能不会返回正确的结果。如果一定要作为查询条件,请将数据库中的类型定义为Numeric或者Decimal。 + +```Go +type account struct { +money float64 `xorm:"Numeric"` +} +``` + +* 为什么Update时Sqlite3返回的affected和其它数据库不一样? + +答:Sqlite3默认Update时返回的是update的查询条件的记录数条数,不管记录是否真的有更新。而Mysql和Postgres默认情况下都是只返回记录中有字段改变的记录数。 + +* xorm有几种命名映射规则? + +答:目前支持SnakeMapper和SameMapper两种。SnakeMapper支持结构体和成员以驼峰式命名而数据库表和字段以下划线连接命名;SameMapper支持结构体和数据库的命名保持一致的映射。 + +* xorm支持复合主键吗? + +答:支持。在定义时,如果有多个字段标记了pk,则这些字段自动成为复合主键,顺序为在struct中出现的顺序。在使用Id方法时,可以用`Id(xorm.PK{1, 2})`的方式来用。 + +* xorm如何使用Join? + +答:一般我们配合Join()和extends标记来进行,比如我们要对两个表进行Join操作,我们可以这样: + + type Userinfo struct { + Id int64 + Name string + DetailId int64 + } + + type Userdetail struct { + Id int64 + Gender int + } + + type User struct { + Userinfo `xorm:"extends"` + Userdetail `xorm:"extends"` + } + + var users = make([]User, 0) + err := engine.Table(&Userinfo{}).Join("LEFT", "userdetail", "userinfo.detail_id = userdetail.id").Find(&users) + +请注意这里的Userinfo在User中的位置必须在Userdetail的前面,因为他在join语句中的顺序在userdetail前面。如果顺序不对,那么对于同名的列,有可能会赋值出错。 + +当然,如果Join语句比较复杂,我们也可以直接用Sql函数 + + err := engine.Sql("select * from userinfo, userdetail where userinfo.detail_id = userdetail.id").Find(&users) \ No newline at end of file diff --git a/docs/QuickStartCN.md b/docs/zh-CN/intro/quick_start.md similarity index 88% rename from docs/QuickStartCN.md rename to docs/zh-CN/intro/quick_start.md index 793d05a4..5c85d5ca 100644 --- a/docs/QuickStartCN.md +++ b/docs/zh-CN/intro/quick_start.md @@ -1,3 +1,8 @@ +--- +name: 快速开始 +sort: 2 +--- + xorm 快速入门 ===== @@ -30,12 +35,7 @@ xorm 快速入门 * [10.事务处理](#110) * [11.缓存](#120) * [12.事件](#125) -* [13.xorm工具](#130) - * [13.1.反转命令](#131) * [14.Examples](#140) -* [15.案例](#150) -* [16.那些年我们踩过的坑](#160) -* [17.讨论](#170) ## 1.创建Orm引擎 @@ -58,7 +58,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/go-xorm/xorm" ) -engine, err := xorm.NewEngine("sqlite3", "./test.db") +engine, err = xorm.NewEngine("sqlite3", "./test.db") defer engine.Close() ``` @@ -764,101 +764,7 @@ xorm支持两种方式的事件,一种是在Struct中的特定方法来作为 其中beforeFunc和afterFunc的原型为func(bean interface{}). - -## 13.xorm工具 -xorm工具提供了xorm命令,能够帮助做很多事情。 - -### 13.1.反转命令 -参见 [xorm工具](https://github.com/go-xorm/cmd) - ## 14.Examples 请访问[https://github.com/go-xorm/xorm/tree/master/examples](https://github.com/go-xorm/xorm/tree/master/examples) - - -## 15.案例 - -* [Gowalker](http://gowalker.org),源代码 [github.com/Unknwon/gowalker](http://github.com/Unknwon/gowalker) - -* [GoDaily Go语言学习网站](http://godaily.org),源代码 [github.com/govc/godaily](http://github.com/govc/godaily) - -* [Sudochina](http://sudochina.com) 和对应的源代码[github.com/insionng/toropress](http://github.com/insionng/toropress) - -* [VeryHour](http://veryhour.com) - - -## 16.那些年我们踩过的坑 -* 怎么同时使用xorm的tag和json的tag? - -答:使用空格 - -```Go -type User struct { - Name string `json:"name" xorm:"name"` -} -``` - -* 我的struct里面包含bool类型,为什么它不能作为条件也没法用Update更新? - -答:默认bool类型因为无法判断是否为空,所以不会自动作为条件也不会作为Update的内容。可以使用UseBool函数,也可以使用Cols函数 - -```Go -engine.Cols("bool_field").Update(&Struct{BoolField:true}) -// UPDATE struct SET bool_field = true -``` - -* 我的struct里面包含float64和float32类型,为什么用他们作为查询条件总是不正确? - -答:默认float32和float64映射到数据库中为float,real,double这几种类型,这几种数据库类型数据库的实现一般都是非精确的。因此作为相等条件查询有可能不会返回正确的结果。如果一定要作为查询条件,请将数据库中的类型定义为Numeric或者Decimal。 - -```Go -type account struct { -money float64 `xorm:"Numeric"` -} -``` - -* 为什么Update时Sqlite3返回的affected和其它数据库不一样? - -答:Sqlite3默认Update时返回的是update的查询条件的记录数条数,不管记录是否真的有更新。而Mysql和Postgres默认情况下都是只返回记录中有字段改变的记录数。 - -* xorm有几种命名映射规则? - -答:目前支持SnakeMapper和SameMapper两种。SnakeMapper支持结构体和成员以驼峰式命名而数据库表和字段以下划线连接命名;SameMapper支持结构体和数据库的命名保持一致的映射。 - -* xorm支持复合主键吗? - -答:支持。在定义时,如果有多个字段标记了pk,则这些字段自动成为复合主键,顺序为在struct中出现的顺序。在使用Id方法时,可以用`Id(xorm.PK{1, 2})`的方式来用。 - -* xorm如何使用Join? - -答:一般我们配合Join()和extends标记来进行,比如我们要对两个表进行Join操作,我们可以这样: - - type Userinfo struct { - Id int64 - Name string - DetailId int64 - } - - type Userdetail struct { - Id int64 - Gender int - } - - type User struct { - Userinfo `xorm:"extends"` - Userdetail `xorm:"extends"` - } - - var users = make([]User, 0) - err := engine.Table(&Userinfo{}).Join("LEFT", "userdetail", "userinfo.detail_id = userdetail.id").Find(&users) - -请注意这里的Userinfo在User中的位置必须在Userdetail的前面,因为他在join语句中的顺序在userdetail前面。如果顺序不对,那么对于同名的列,有可能会赋值出错。 - -当然,如果Join语句比较复杂,我们也可以直接用Sql函数 - - err := engine.Sql("select * from userinfo, userdetail where userinfo.detail_id = userdetail.id").Find(&users) - - -## 17.讨论 -请加入QQ群:280360085 进行讨论。 diff --git a/docs/zh-CN/intro/tools.md b/docs/zh-CN/intro/tools.md new file mode 100644 index 00000000..551dcc0a --- /dev/null +++ b/docs/zh-CN/intro/tools.md @@ -0,0 +1,109 @@ +--- +root: false +name: xorm 工具 +sort: 3 +--- + +# xorm 工具 + +xorm 是一组数据库操作命令行工具。 + +## 二进制安装 + +如果你安装了 [got](https://github.com/gobuild/got),你可以输入如下命令安装: + +``` +got go-xorm/cmd/xorm +``` + +或者你可以从 [gobuild](http://gobuild.io/download/github.com/lunny/got) 下载后解压到可执行路径。 + +## 源码安装 + +`go get github.com/go-xorm/cmd/xorm` + +同时你需要安装如下依赖: + +* github.com/go-xorm/xorm + +* Mysql: [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + +* MyMysql: [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql/godrv) + +* Postgres: [github.com/lib/pq](https://github.com/lib/pq) + +* SQLite: [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + +** 对于sqlite3的支持,你需要自己进行编译 `go build -tags sqlite3` 因为sqlite3需要cgo的支持。 + +## 命令列表 + +有如下可用的命令: + +* **reverse** 反转一个数据库结构,生成代码 +* **shell** 通用的数据库操作客户端,可对数据库结构和数据操作 +* **dump** Dump数据库中所有结构和数据到标准输出 +* **source** 从标注输入中执行SQL文件 +* **driver** 列出所有支持的数据库驱动 + +## reverse + +Reverse command is a tool to convert your database struct to all kinds languages of structs or classes. After you installed the tool, you can type + +`xorm help reverse` + +to get help + +example: + +sqlite: +`xorm reverse sqite3 test.db templates/goxorm` + +mysql: +`xorm reverse mysql root:@/xorm_test?charset=utf8 templates/goxorm` + +mymysql: +`xorm reverse mymysql xorm_test2/root/ templates/goxorm` + +postgres: +`xorm reverse postgres "dbname=xorm_test sslmode=disable" templates/goxorm` + +will generated go files in `./model` directory + +### Template and Config + +Now, xorm tool supports go and c++ two languages and have go, goxorm, c++ three of default templates. In template directory, we can put a config file to control how to generating. + +```` +lang=go +genJson=1 +``` + +lang must be go or c++ now. +genJson can be 1 or 0, if 1 then the struct will have json tag. + +## Shell + +Shell command provides a tool to operate database. For example, you can create table, alter table, insert data, delete data and etc. + +`xorm shell sqlite3 test.db` will connect to the sqlite3 database and you can type `help` to list all the shell commands. + +## Dump + +Dump command provides a tool to dump all database structs and data as SQL to your standard output. + +`xorm dump sqlite3 test.db` could dump sqlite3 database test.db to standard output. If you want to save to file, just +type `xorm dump sqlite3 test.db > test.sql`. + +## Source + +`xorm source sqlite3 test.db < test.sql` will execute sql file on the test.db. + +## Driver + +List all supported drivers since default build will not include sqlite3. + +## LICENSE + + BSD License + [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) diff --git a/docs/zh-CN/team.md b/docs/zh-CN/team.md new file mode 100644 index 00000000..4d18bb14 --- /dev/null +++ b/docs/zh-CN/team.md @@ -0,0 +1,22 @@ +# 开发者团队 + +### 无闻 + +- 团队角色:项目管理员,后端开发者 +- 社交网络:[新浪微博](http://weibo.com/Obahua) [GitHub](https://github.com/Unknwon) [Twitter](https://twitter.com/joe2010xtmf) [Google+](https://plus.google.com/u/0/+JiahuaChen) + +### Lunny + +- 团队角色:后端 Git 和数据库部分开发者 +- 社交网络:[新浪微博](http://weibo.com/xiaolunwen) [GitHub](https://github.com/lunny) [Twitter](https://twitter.com/lunny) + +### 傅小黑 + +- 团队角色:前端开发者 +- 社交网络:[新浪微博](http://weibo.com/fuxiaohei) [GitHub](https://github.com/fuxiaohei) + + +### Slene + +- 团队角色:前、后端开发者 +- 社交网络:[新浪微博](http://weibo.com/slene) [GitHub](https://github.com/slene) [Twitter](https://twitter.com/slene) \ No newline at end of file