summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-xorm/xorm/README.md
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-06-23 23:22:43 +0800
committerLauris BH <lauris@nix.lv>2019-06-23 18:22:43 +0300
commitaa7c34cf86081b71f796f6e5da60e62a3cda43ce (patch)
treec9e4b4f1490b43e942fa71b37748072d3fe441e8 /vendor/github.com/go-xorm/xorm/README.md
parentbaefea311f1a66a97f9a2779ad3342f4f8167d28 (diff)
downloadgitea-aa7c34cf86081b71f796f6e5da60e62a3cda43ce.tar.gz
gitea-aa7c34cf86081b71f796f6e5da60e62a3cda43ce.zip
Fix error log when loading issues caused by a xorm bug (#7271)
* fix error log when loading issues caused by a xorm bug * upgrade packages * fix fmt * fix Consistency * fix tests
Diffstat (limited to 'vendor/github.com/go-xorm/xorm/README.md')
-rw-r--r--vendor/github.com/go-xorm/xorm/README.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/github.com/go-xorm/xorm/README.md b/vendor/github.com/go-xorm/xorm/README.md
index 6a57606e7f..2b839d520f 100644
--- a/vendor/github.com/go-xorm/xorm/README.md
+++ b/vendor/github.com/go-xorm/xorm/README.md
@@ -28,7 +28,7 @@ Xorm is a simple and powerful ORM for Go.
* Optimistic Locking support
-* SQL Builder support via [github.com/go-xorm/builder](https://github.com/go-xorm/builder)
+* SQL Builder support via [xorm.io/builder](https://xorm.io/builder)
* Automatical Read/Write seperatelly
@@ -151,20 +151,20 @@ has, err := engine.Where("name = ?", name).Desc("id").Get(&user)
// SELECT * FROM user WHERE name = ? ORDER BY id DESC LIMIT 1
var name string
-has, err := engine.Where("id = ?", id).Cols("name").Get(&name)
+has, err := engine.Table(&user).Where("id = ?", id).Cols("name").Get(&name)
// SELECT name FROM user WHERE id = ?
var id int64
-has, err := engine.Where("name = ?", name).Cols("id").Get(&id)
+has, err := engine.Table(&user).Where("name = ?", name).Cols("id").Get(&id)
has, err := engine.SQL("select id from user").Get(&id)
// SELECT id FROM user WHERE name = ?
var valuesMap = make(map[string]string)
-has, err := engine.Where("id = ?", id).Get(&valuesMap)
+has, err := engine.Table(&user).Where("id = ?", id).Get(&valuesMap)
// SELECT * FROM user WHERE id = ?
var valuesSlice = make([]interface{}, len(cols))
-has, err := engine.Where("id = ?", id).Cols(cols...).Get(&valuesSlice)
+has, err := engine.Table(&user).Where("id = ?", id).Cols(cols...).Get(&valuesSlice)
// SELECT col1, col2, col3 FROM user WHERE id = ?
```
@@ -363,7 +363,7 @@ return session.Commit()
* Or you can use `Transaction` to replace above codes.
```Go
-res, err := engine.Transaction(func(sess *xorm.Session) (interface{}, error) {
+res, err := engine.Transaction(func(session *xorm.Session) (interface{}, error) {
user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()}
if _, err := session.Insert(&user1); err != nil {
return nil, err
@@ -493,4 +493,4 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
## LICENSE
-BSD License [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/) \ No newline at end of file
+BSD License [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/)