Upgrade xorm to v1.0.0 (#10646)

* Upgrade xorm to v1.0.0

* small nit

* Fix tests

* Update xorm

* Update xorm

* fix go.sum

* fix test

* Fix bug when dump

* Fix bug

* update xorm to latest

* Fix migration test

* update xorm to latest

* Fix import order

* Use xorm tag
This commit is contained in:
Lunny Xiao 2020-03-22 23:12:55 +08:00 committed by GitHub
parent dcaa5643d7
commit c61b902538
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
154 changed files with 7195 additions and 5962 deletions

View file

@ -21,6 +21,9 @@ func (b *Builder) limitWriteTo(w Writer) error {
}
// erase limit condition
b.limitation = nil
defer func() {
b.limitation = limit
}()
ow := w.(*BytesWriter)
switch strings.ToLower(strings.TrimSpace(b.dialect)) {
@ -34,7 +37,7 @@ func (b *Builder) limitWriteTo(w Writer) error {
b.selects = append(selects, "ROWNUM RN")
var wb *Builder
if b.optype == unionType {
if b.optype == setOpType {
wb = Dialect(b.dialect).Select("at.*", "ROWNUM RN").
From(b, "at")
} else {
@ -55,7 +58,7 @@ func (b *Builder) limitWriteTo(w Writer) error {
return final.WriteTo(ow)
case SQLITE, MYSQL, POSTGRES:
// if type UNION, we need to write previous content back to current writer
if b.optype == unionType {
if b.optype == setOpType {
if err := b.WriteTo(ow); err != nil {
return err
}
@ -77,7 +80,7 @@ func (b *Builder) limitWriteTo(w Writer) error {
b.selects[1:]...), "ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS RN")
var wb *Builder
if b.optype == unionType {
if b.optype == setOpType {
wb = Dialect(b.dialect).Select("*", "ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS RN").
From(b, "at")
} else {