mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-22 01:34:18 +00:00
update latest xorm version to vendor (#2353)
This commit is contained in:
parent
5c29b0a5fe
commit
2c6a0fdca8
44 changed files with 1748 additions and 1414 deletions
63
vendor/github.com/go-xorm/xorm/README.md
generated
vendored
63
vendor/github.com/go-xorm/xorm/README.md
generated
vendored
|
@ -2,11 +2,9 @@
|
|||
|
||||
Xorm is a simple and powerful ORM for Go.
|
||||
|
||||
[](https://circleci.com/gh/go-xorm/xorm/tree/master) [](https://gitter.im/go-xorm/xorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
# Notice
|
||||
|
||||
The last master version is not backwards compatible. You should use `engine.ShowSQL()` and `engine.Logger().SetLevel()` instead of `engine.ShowSQL = `, `engine.ShowInfo = ` and so on.
|
||||
[](https://circleci.com/gh/go-xorm/xorm) [](https://codecov.io/gh/go-xorm/xorm)
|
||||
[](https://goreportcard.com/report/github.com/go-xorm/xorm)
|
||||
[](https://discord.gg/HuR2CF3)
|
||||
|
||||
# Features
|
||||
|
||||
|
@ -50,6 +48,14 @@ Drivers for Go's sql package which currently support database/sql includes:
|
|||
|
||||
# Changelog
|
||||
|
||||
* **v0.6.3**
|
||||
* merge tests to main project
|
||||
* add `Exist` function
|
||||
* add `SumInt` function
|
||||
* Mysql now support read and create column comment.
|
||||
* fix time related bugs.
|
||||
* fix some other bugs.
|
||||
|
||||
* **v0.6.2**
|
||||
* refactor tag parse methods
|
||||
* add Scan features to Get
|
||||
|
@ -62,22 +68,6 @@ methods can use `builder.Cond` as parameter
|
|||
* add Sum, SumInt, SumInt64 and NotIn methods
|
||||
* some bugs fixed
|
||||
|
||||
* **v0.5.0**
|
||||
* logging interface changed
|
||||
* some bugs fixed
|
||||
|
||||
* **v0.4.5**
|
||||
* many bugs fixed
|
||||
* extends support unlimited deepth
|
||||
* Delete Limit support
|
||||
|
||||
* **v0.4.4**
|
||||
* ql database expriment support
|
||||
* tidb database expriment support
|
||||
* sql.NullString and etc. field support
|
||||
* select ForUpdate support
|
||||
* many bugs fixed
|
||||
|
||||
[More changes ...](https://github.com/go-xorm/manual-en-US/tree/master/chapter-16)
|
||||
|
||||
# Installation
|
||||
|
@ -124,7 +114,7 @@ results, err := engine.Query("select * from user")
|
|||
results, err := engine.QueryString("select * from user")
|
||||
```
|
||||
|
||||
* `Execute` runs a SQL string, it returns `affetcted` and `error`
|
||||
* `Execute` runs a SQL string, it returns `affected` and `error`
|
||||
|
||||
```Go
|
||||
affected, err := engine.Exec("update user set age = ? where name = ?", age, name)
|
||||
|
@ -166,6 +156,25 @@ has, err := engine.Where("id = ?", id).Cols(cols...).Get(&valuesSlice)
|
|||
// SELECT col1, col2, col3 FROM user WHERE id = ?
|
||||
```
|
||||
|
||||
* Check if one record exist on table
|
||||
|
||||
```Go
|
||||
has, err := testEngine.Exist(new(RecordExist))
|
||||
// SELECT * FROM record_exist LIMIT 1
|
||||
has, err = testEngine.Exist(&RecordExist{
|
||||
Name: "test1",
|
||||
})
|
||||
// SELECT * FROM record_exist WHERE name = ? LIMIT 1
|
||||
has, err = testEngine.Where("name = ?", "test1").Exist(&RecordExist{})
|
||||
// SELECT * FROM record_exist WHERE name = ? LIMIT 1
|
||||
has, err = testEngine.SQL("select * from record_exist where name = ?", "test1").Exist()
|
||||
// select * from record_exist where name = ?
|
||||
has, err = testEngine.Table("record_exist").Exist()
|
||||
// SELECT * FROM record_exist LIMIT 1
|
||||
has, err = testEngine.Table("record_exist").Where("name = ?", "test1").Exist()
|
||||
// SELECT * FROM record_exist WHERE name = ? LIMIT 1
|
||||
```
|
||||
|
||||
* Query multiple records from database, also you can use join and extends
|
||||
|
||||
```Go
|
||||
|
@ -258,13 +267,21 @@ err := engine.Where(builder.NotIn("a", 1, 2).And(builder.In("b", "c", "d", "e"))
|
|||
|
||||
# Cases
|
||||
|
||||
* [studygolang](http://studygolang.com/) - [github.com/studygolang/studygolang](https://github.com/studygolang/studygolang)
|
||||
|
||||
* [Gitea](http://gitea.io) - [github.com/go-gitea/gitea](http://github.com/go-gitea/gitea)
|
||||
|
||||
* [Gogs](http://try.gogits.org) - [github.com/gogits/gogs](http://github.com/gogits/gogs)
|
||||
|
||||
* [grafana](https://grafana.com/) - [github.com/grafana/grafana](http://github.com/grafana/grafana)
|
||||
|
||||
* [github.com/m3ng9i/qreader](https://github.com/m3ng9i/qreader)
|
||||
|
||||
* [Wego](http://github.com/go-tango/wego)
|
||||
|
||||
* [Docker.cn](https://docker.cn/)
|
||||
|
||||
* [Gogs](http://try.gogits.org) - [github.com/gogits/gogs](http://github.com/gogits/gogs)
|
||||
* [Xorm Adapter](https://github.com/casbin/xorm-adapter) for [Casbin](https://github.com/casbin/casbin) - [github.com/casbin/xorm-adapter](https://github.com/casbin/xorm-adapter)
|
||||
|
||||
* [Gorevel](http://gorevel.cn/) - [github.com/goofcc/gorevel](http://github.com/goofcc/gorevel)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue