From 22036f5c521b6f1244a3badafddd39bb2a5b8d9c Mon Sep 17 00:00:00 2001 From: robhafner Date: Mon, 10 Oct 2022 23:01:15 -0400 Subject: [PATCH] Fix condition for limit (#5735) (#118) The limit clause should be included when the limit value is greater than or equal to zero. --- sqlite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite.go b/sqlite.go index 6456289..cb1afff 100644 --- a/sqlite.go +++ b/sqlite.go @@ -101,7 +101,7 @@ func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder { if limit.Limit != nil && *limit.Limit >= 0 { lmt = *limit.Limit } - if lmt > 0 || limit.Offset > 0 { + if lmt >= 0 || limit.Offset > 0 { builder.WriteString("LIMIT ") builder.WriteString(strconv.Itoa(lmt)) }