From 260506352fb63605c72ad24998c32564f8166762 Mon Sep 17 00:00:00 2001 From: Aneurin Barker Snook Date: Fri, 10 Jul 2026 08:35:15 +0100 Subject: [PATCH] fix limit, offset bugs --- select.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/select.go b/select.go index daaa682..faee5e8 100644 --- a/select.go +++ b/select.go @@ -109,8 +109,8 @@ func (q *SelectQuery) RightJoin(def string) *SelectQuery { return q } -func (q *SelectQuery) Offset(limit int) *SelectQuery { - q.limit = limit +func (q *SelectQuery) Offset(offset int) *SelectQuery { + q.offset = offset return q } @@ -215,7 +215,7 @@ func (q *SelectQuery) String() string { if q.limit > 0 { if q.offset > 0 { - strs = append(strs, fmt.Sprintf("limit %d offset %d", q.offset, q.limit)) + strs = append(strs, fmt.Sprintf("limit %d offset %d", q.limit, q.offset)) } else { strs = append(strs, fmt.Sprintf("limit %d", q.limit)) }