mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
Merge pull request #1464 from tb365/feature/tb-update-mod-0702
update mod
This commit is contained in:
@@ -153,6 +153,6 @@ require (
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30
|
||||
yunion.io/x/sqlchemy v0.0.0-20190629024351-0b058bbe38b9
|
||||
yunion.io/x/sqlchemy v0.0.0-20190701085445-12b2b4318f7d
|
||||
yunion.io/x/structarg v0.0.0-20190625074850-3c0636a9fffe
|
||||
)
|
||||
|
||||
@@ -482,7 +482,7 @@ yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf h1:OsKC+2ghZHwp+Ztm/MwKlLKKRi
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30 h1:6CkrwtX4xeYFqqpdWtQPAVqEnD3aEivPLOLzNKNPAB0=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/sqlchemy v0.0.0-20190629024351-0b058bbe38b9 h1:fcWkDven+31hhZIihZQ6ITmTmTiSv8xeF0oaQs/3DaI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20190629024351-0b058bbe38b9/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20190701085445-12b2b4318f7d h1:b6gMLwNLzovRgmENv2tBJZKCf3gydQqnJmDd9QeVNrg=
|
||||
yunion.io/x/sqlchemy v0.0.0-20190701085445-12b2b4318f7d/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20190625074850-3c0636a9fffe h1:Wr2EXv72ynwtW+x0VCqWwpsfUBWecaZWnLMgaP3UiTo=
|
||||
yunion.io/x/structarg v0.0.0-20190625074850-3c0636a9fffe/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
Vendored
+1
-1
@@ -757,7 +757,7 @@ yunion.io/x/pkg/util/prometheus
|
||||
yunion.io/x/pkg/prettytable
|
||||
yunion.io/x/pkg/util/runtime
|
||||
yunion.io/x/pkg/util/clock
|
||||
# yunion.io/x/sqlchemy v0.0.0-20190629024351-0b058bbe38b9
|
||||
# yunion.io/x/sqlchemy v0.0.0-20190701085445-12b2b4318f7d
|
||||
yunion.io/x/sqlchemy
|
||||
# yunion.io/x/structarg v0.0.0-20190625074850-3c0636a9fffe
|
||||
yunion.io/x/structarg
|
||||
|
||||
+9
@@ -21,6 +21,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/reflectutils"
|
||||
"yunion.io/x/pkg/utils"
|
||||
@@ -192,6 +193,14 @@ func (us *SUpdateSession) saveUpdate(dt interface{}) (UpdateDiffs, error) {
|
||||
if aCnt != 1 {
|
||||
return nil, fmt.Errorf("affected rows %d != 1", aCnt)
|
||||
}
|
||||
q := us.tableSpec.Query()
|
||||
for k, v := range primaries {
|
||||
q = q.Equals(k, v)
|
||||
}
|
||||
err = q.First(dt)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "query after update failed")
|
||||
}
|
||||
return setters, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user