From 191048f40d346a983b9991f4aa9626063c77d0c9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 29 Jun 2024 16:58:36 +0800 Subject: [PATCH] 1 --- dbpool.go | 1 + types.go | 1 + 2 files changed, 2 insertions(+) diff --git a/dbpool.go b/dbpool.go index b9a598f..7073aca 100644 --- a/dbpool.go +++ b/dbpool.go @@ -387,6 +387,7 @@ func (this *dbPool) StreamPageQuery( pagination.PreviousCursor = cursor for rows.Next() { if (rows.NumOfReaded() <= int64(pageSize)) { + pagination.Count += 1 fillCb(rows) if (rows.NumOfReaded() == int64(pageSize)) { pagination.NextCursor = q5.ToInt64(rows.GetByName("idx")) diff --git a/types.go b/types.go index b43f47e..7ca5e2e 100644 --- a/types.go +++ b/types.go @@ -32,6 +32,7 @@ type StreamPagination struct { NextCursor int64 PreviousCursor int64 Remaining int32 + Count int32 } type GinHandlerFunc func(*gin.Context)