diff --git a/storage/postgres/log.go b/storage/postgres/log.go index f135df7..f7f6bd0 100644 --- a/storage/postgres/log.go +++ b/storage/postgres/log.go @@ -251,7 +251,10 @@ func (c *Log) GetQueryBaseFromSearchOptions(opt *model.SearchOptions) sq.SelectB if offset < 0 { offset = 0 } - return base.Offset(uint64(offset)).Limit(uint64(opt.Size + 1)) + if opt.Size != 0 { + base = base.Limit(uint64(opt.Size + 1)) + } + return base.Offset(uint64(offset)) } func (c *Log) GetQueryBase(fields []string) sq.SelectBuilder {