chore(db): introduce db.Session and db.EngineMigration interfaces (#37746)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Copilot
2026-05-18 03:56:39 +08:00
committed by GitHub
co-authored by copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> wxiaoguang wxiaoguang
parent d9149d8a0a
commit 94e3482d1a
300 changed files with 745 additions and 864 deletions
+2 -2
View File
@@ -339,7 +339,7 @@ func GetUserFollowers(ctx context.Context, u, viewer *User, listOptions db.ListO
And(isUserVisibleToViewerCond(viewer))
if listOptions.Page > 0 {
sess = db.SetSessionPagination(sess, &listOptions)
db.SetSessionPagination(sess, &listOptions)
users := make([]*User, 0, listOptions.PageSize)
count, err := sess.FindAndCount(&users)
@@ -361,7 +361,7 @@ func GetUserFollowing(ctx context.Context, u, viewer *User, listOptions db.ListO
And(isUserVisibleToViewerCond(viewer))
if listOptions.Page > 0 {
sess = db.SetSessionPagination(sess, &listOptions)
db.SetSessionPagination(sess, &listOptions)
users := make([]*User, 0, listOptions.PageSize)
count, err := sess.FindAndCount(&users)