From 1927a64cf31f64a9672f070be1c012b562640c89 Mon Sep 17 00:00:00 2001 From: Nash Tsai Date: Wed, 12 Feb 2014 11:29:27 +0800 Subject: [PATCH 1/4] Update CONTRIBUTING.md add links for fork a repo to --- CONTRIBUTING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7fde071..6f65c2ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,17 @@ ## Contributing to xorm -`xorm` has a backlog of pull requests, but contributions are still very +`xorm` has a backlog of [pull requests](https://help.github.com/articles/using-pull-requests), but contributions are still very much welcome. You can help with patch review, submitting bug reports, or adding new functionality. There is no formal style guide, but please conform to the style of existing code and general Go formatting conventions when submitting patches. +* [fork a repo](https://help.github.com/articles/fork-a-repo) +* [creating a pull request ](https://help.github.com/articles/creating-a-pull-request) + ### Patch review -Help review existing open pull requests by commenting on the code or +Help review existing open [pull requests](https://help.github.com/articles/using-pull-requests) by commenting on the code or proposed functionality. ### Bug reports From f76bd3b102c97d25ec7ad242d4367e5f603ee792 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 12 Feb 2014 15:10:37 +0800 Subject: [PATCH 2/4] add gobuild as cases --- README.md | 2 ++ README_CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 85e5d46c..c5fb4ca7 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ Or * [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) diff --git a/README_CN.md b/README_CN.md index 8088f423..d7e8de80 100644 --- a/README_CN.md +++ b/README_CN.md @@ -81,6 +81,8 @@ xorm是一个简单而强大的Go语言ORM库. 通过它可以使数据库操作 * [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) From 146d5db5eae5fb854e607591d4aa0cc66b0cc4c4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 18 Feb 2014 14:10:51 +0800 Subject: [PATCH 3/4] bug fixed --- mysql.go | 3 ++- session.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql.go b/mysql.go index aff13333..23b53641 100644 --- a/mysql.go +++ b/mysql.go @@ -111,6 +111,7 @@ func (db *mysql) SqlType(c *Column) string { switch t := c.SQLType.Name; t { case Bool: res = TinyInt + c.Length = 1 case Serial: c.IsAutoIncrement = true c.IsPrimaryKey = true @@ -259,7 +260,7 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*Column, err if col.SQLType.IsText() { if col.Default != "" { col.Default = "'" + col.Default + "'" - }else{ + } else { if col.DefaultIsEmpty { col.Default = "''" } diff --git a/session.go b/session.go index 75570fcd..825acc46 100644 --- a/session.go +++ b/session.go @@ -2627,7 +2627,7 @@ func (session *Session) innerInsert(bean interface{}) (int64, error) { // Method InsertOne insert only one struct into database as a record. // The in parameter bean must a struct or a point to struct. The return -// parameter is lastInsertId and error +// parameter is inserted and error func (session *Session) InsertOne(bean interface{}) (int64, error) { err := session.newDb() if err != nil { From 45b3f9775eff90e984129cb08e77b0b7f883ef0f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 25 Feb 2014 18:45:24 +0800 Subject: [PATCH 4/4] bug fixed for statement.IdParam --- statement.go | 1 + 1 file changed, 1 insertion(+) diff --git a/statement.go b/statement.go index b36a2ebf..4bde5c7b 100644 --- a/statement.go +++ b/statement.go @@ -61,6 +61,7 @@ func (statement *Statement) Init() { statement.columnMap = make(map[string]bool) statement.ConditionStr = "" statement.AltTableName = "" + statement.IdParam = nil statement.RawSQL = "" statement.RawParams = make([]interface{}, 0) statement.BeanArgs = make([]interface{}, 0)