Skip to content

Commit 56ccb75

Browse files
committed
fix(bunpaginate): with column
1 parent 899f116 commit 56ccb75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bun/bunpaginate/pagination_column.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func UsingColumn[FILTERS any, ENTITY any](ctx context.Context,
1717
query ColumnPaginatedQuery[FILTERS]) (*Cursor[ENTITY], error) {
1818
ret := make([]ENTITY, 0)
1919

20+
sb = sb.Model(&ret)
2021
sb = sb.Limit(int(query.PageSize) + 1) // Fetch one additional item to find the next token
2122
order := query.Order
2223
if query.Reverse {
@@ -42,7 +43,7 @@ func UsingColumn[FILTERS any, ENTITY any](ctx context.Context,
4243
}
4344
}
4445

45-
if err := sb.Scan(ctx, &ret); err != nil {
46+
if err := sb.Scan(ctx); err != nil {
4647
return nil, err
4748
}
4849

0 commit comments

Comments
 (0)