fix: fix sqlchemy version to v1.0.0 for release/3.8

This commit is contained in:
Qiu Jian
2021-11-17 14:42:29 +08:00
parent 83da0272e7
commit 50f0e77fb6
6 changed files with 50 additions and 9 deletions
+2 -1
View File
@@ -268,7 +268,8 @@ dep:
@$(MAKE) mod
mod:
go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | grep -v sqlchemy))
go get -d yunion.io/x/sqlchemy@v1.0.0
go mod tidy
go mod vendor -v
+2 -2
View File
@@ -152,8 +152,8 @@ require (
yunion.io/x/jsonutils v0.0.0-20211105163012-d846c05a3c9a
yunion.io/x/log v0.0.0-20201210064738-43181789dc74
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f
yunion.io/x/pkg v0.0.0-20211116020154-6a76ba2f7e97
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada
yunion.io/x/sqlchemy v1.0.0
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
)
+4 -4
View File
@@ -926,11 +926,11 @@ yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7/go.mod h1:0vLkNEhlmA64HViPB
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f h1:maply0f3AsvoXqkpTKkb6/tZFbRAT/rdkk1Cw3FkoB8=
yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20211116020154-6a76ba2f7e97 h1:lY+5NlWwO2aIkfNnVOGKHmZvMt6m4ZuGtarIjwNfUsg=
yunion.io/x/pkg v0.0.0-20211116020154-6a76ba2f7e97/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada h1:ZIhSSwFHfnzPMKSyiN0nkGwvC6RUeuCIAnWuTtDS900=
yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/sqlchemy v1.0.0 h1:fRtWxe1xxMR+NDVKYNuI89m2HGSl6aad2DZ+Bn/mZ4Q=
yunion.io/x/sqlchemy v1.0.0/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce h1:kU8xE7O5uZ1GSJVMZHoJ+jrNL7csUQHYGyAPW9QfNpE=
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
+2 -2
View File
@@ -1169,7 +1169,7 @@ yunion.io/x/log/hooks
yunion.io/x/ovsdb/cli_util
yunion.io/x/ovsdb/schema/ovn_nb
yunion.io/x/ovsdb/types
# yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f
# yunion.io/x/pkg v0.0.0-20211116020154-6a76ba2f7e97
yunion.io/x/pkg/errors
yunion.io/x/pkg/gotypes
yunion.io/x/pkg/prettytable
@@ -1203,7 +1203,7 @@ yunion.io/x/pkg/util/workqueue
yunion.io/x/pkg/utils
# yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/s3cli
# yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada
# yunion.io/x/sqlchemy v1.0.0
yunion.io/x/sqlchemy
# yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
yunion.io/x/structarg
+18
View File
@@ -38,6 +38,9 @@ var DATE_COMPACT_REG *regexp.Regexp
var ISO_TIME_REG *regexp.Regexp
var ISO_NO_SECOND_TIME_REG *regexp.Regexp
var FULLISO_TIME_REG *regexp.Regexp
var ISO_TIME_REG2 *regexp.Regexp
var ISO_NO_SECOND_TIME_REG2 *regexp.Regexp
var FULLISO_TIME_REG2 *regexp.Regexp
var ZSTACK_TIME_REG *regexp.Regexp
var COMPACT_TIME_REG *regexp.Regexp
var MYSQL_TIME_REG *regexp.Regexp
@@ -68,6 +71,9 @@ func init() {
ISO_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$`)
ISO_NO_SECOND_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$`)
FULLISO_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3,9}(Z|[+-]\d{2}:\d{2})$`)
ISO_TIME_REG2 = regexp.MustCompile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$`)
ISO_NO_SECOND_TIME_REG2 = regexp.MustCompile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$`)
FULLISO_TIME_REG2 = regexp.MustCompile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3,9}(Z|[+-]\d{2}:\d{2})$`)
COMPACT_TIME_REG = regexp.MustCompile(`^\d{14}$`)
ZSTACK_TIME_REG = regexp.MustCompile(`^\w+ \d{1,2}, \d{4} \d{1,2}:\d{1,2}:\d{1,2} (AM|PM)$`) //ZStack time format "Apr 1, 2019 3:23:17 PM"
MYSQL_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$`)
@@ -202,6 +208,18 @@ func MatchFullISOTime(str string) bool {
return FULLISO_TIME_REG.MatchString(str)
}
func MatchISOTime2(str string) bool {
return ISO_TIME_REG2.MatchString(str)
}
func MatchISONoSecondTime2(str string) bool {
return ISO_NO_SECOND_TIME_REG2.MatchString(str)
}
func MatchFullISOTime2(str string) bool {
return FULLISO_TIME_REG2.MatchString(str)
}
func MatchCompactTime(str string) bool {
return COMPACT_TIME_REG.MatchString(str)
}
+22
View File
@@ -58,6 +58,10 @@ const (
ShortMonthFormat = "200601"
ZStackTimeFormat = "Jan 2, 2006 15:04:05 PM"
IsoTimeFormat2 = "2006-01-02 15:04:05Z07:00"
IsoNoSecondTimeFormat2 = "2006-01-02 15:04Z07:00"
FullIsoNanoTimeFormat2 = "2006-01-02 15:04:05.000000000Z07:00"
RFC2882Format = time.RFC1123
)
@@ -113,10 +117,18 @@ func ParseIsoTime(str string) (time.Time, error) {
return time.Parse(IsoTimeFormat, str)
}
func ParseIsoTime2(str string) (time.Time, error) {
return time.Parse(IsoTimeFormat2, str)
}
func ParseIsoNoSecondTime(str string) (time.Time, error) {
return time.Parse(IsoNoSecondTimeFormat, str)
}
func ParseIsoNoSecondTime2(str string) (time.Time, error) {
return time.Parse(IsoNoSecondTimeFormat2, str)
}
func toFullIsoNanoTimeFormat(str string) string {
// 2019-09-17T20:50:17.66667134+08:00
// 2019-11-19T18:54:48.084-08:00
@@ -143,6 +155,10 @@ func ParseFullIsoTime(str string) (time.Time, error) {
return time.Parse(FullIsoNanoTimeFormat, toFullIsoNanoTimeFormat(str))
}
func ParseFullIsoTime2(str string) (time.Time, error) {
return time.Parse(FullIsoNanoTimeFormat2, toFullIsoNanoTimeFormat(str))
}
func ParseMysqlTime(str string) (time.Time, error) {
return time.Parse(MysqlTimeFormat, str)
}
@@ -183,6 +199,12 @@ func ParseTimeStr(str string) (time.Time, error) {
return ParseIsoTime(str)
} else if regutils.MatchISONoSecondTime(str) {
return ParseIsoNoSecondTime(str)
} else if regutils.MatchFullISOTime2(str) {
return ParseFullIsoTime2(str)
} else if regutils.MatchISOTime2(str) {
return ParseIsoTime2(str)
} else if regutils.MatchISONoSecondTime2(str) {
return ParseIsoNoSecondTime2(str)
} else if regutils.MatchMySQLTime(str) {
return ParseMysqlTime(str)
} else if regutils.MatchNormalTime(str) {