sqlx: use yesql => v1.3.0

r/paopao-ce-plus
Michael Li 1 year ago
parent 2d0477cf65
commit fc3659b4a2
No known key found for this signature in database

@ -7,7 +7,7 @@ require (
github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868
github.com/alimy/cfg v0.3.0
github.com/alimy/mir/v4 v4.0.0-rc.1
github.com/alimy/yesql v1.2.0
github.com/alimy/yesql v1.3.0
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/allegro/bigcache/v3 v3.1.0
github.com/bytedance/sonic v1.9.2

@ -127,8 +127,8 @@ github.com/alimy/cfg v0.3.0 h1:9xgA0QWVCPSq9fFNRcYahVCAX22IL9ts2wrTQPfAStY=
github.com/alimy/cfg v0.3.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c=
github.com/alimy/mir/v4 v4.0.0-rc.1 h1:x9rKbD6I4INqwvgmSI4Vbswff66ANDnPmCySMLzEV4w=
github.com/alimy/mir/v4 v4.0.0-rc.1/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc=
github.com/alimy/yesql v1.2.0 h1:yWa4kYk/7E2iYtS/4xvjlKQvGsfRhAHqr58s5Sig33A=
github.com/alimy/yesql v1.2.0/go.mod h1:Y0FdRIwIbJyTv56wSX+MpaIHiAW1PyKTDYO6K/er4JY=
github.com/alimy/yesql v1.3.0 h1:4/p097ZvFMlIzm1CWYy1q+eBQH0DcqlB+/UxKTHsj30=
github.com/alimy/yesql v1.3.0/go.mod h1:Y0FdRIwIbJyTv56wSX+MpaIHiAW1PyKTDYO6K/er4JY=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible h1:KpbJFXwhVeuxNtBJ74MCGbIoaBok2uZvkD7QXp2+Wis=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk=

@ -151,6 +151,15 @@ func mustBuild[T any](db *sqlx.DB, fn func(yesql.PreparexBuilder, ...context.Con
return obj
}
func mustBuildFn[T any](db *sqlx.DB, fn func(yesql.PreparexBuilder) (T, error)) T {
p := yesql.NewPreparexBuilder(db, t)
obj, err := fn(p)
if err != nil {
logrus.Fatalf("build object failure: %s", err)
}
return obj
}
func initSqlxDB() {
_db = conf.MustSqlxDB()
_tablePrefix = conf.DatabaseSetting.TablePrefix

@ -467,7 +467,7 @@ func newTweetManageService(db *sqlx.DB, cacheIndex core.CacheIndexService) core.
func newTweetHelpService(db *sqlx.DB) core.TweetHelpService {
return &tweetHelpSrv{
sqlxSrv: newSqlxSrv(db),
q: mustBuild(db, cc.BuildTweetHelp),
q: mustBuildFn(db, cc.BuildTweetHelp),
}
}

@ -1,6 +1,6 @@
// Code generated by Yesql. DO NOT EDIT.
// versions:
// - Yesql v1.2.0
// - Yesql v1.3.0
package cc
@ -596,13 +596,7 @@ func BuildTweetA(p yesql.PreparexBuilder, ctx ...context.Context) (obj *TweetA,
return
}
func BuildTweetHelp(p yesql.PreparexBuilder, ctx ...context.Context) (obj *TweetHelp, err error) {
var c context.Context
if len(ctx) > 0 && ctx[0] != nil {
c = ctx[0]
} else {
c = context.Background()
}
func BuildTweetHelp(p yesql.PreparexBuilder) (obj *TweetHelp, err error) {
obj = &TweetHelp{
GetPostContentByIds: p.QueryHook(_GetPostContentByIds_TweetHelp),
GetUsersByIds: p.QueryHook(_GetUsersByIds_TweetHelp),

Loading…
Cancel
Save