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)