Only apply NaiveOffset and NaiveLimit when appropriate

parent 2cec99fa
......@@ -262,7 +262,15 @@ func (d *Datastore) Query(q query.Query) (query.Results, error) {
Close: queries.close,
})
return query.NaiveLimit(query.NaiveOffset(qr, offset), q.Limit), nil
if offset > 0 {
qr = query.NaiveOffset(qr, offset)
}
if q.Limit > 0 {
qr = query.NaiveLimit(qr, q.Limit)
}
return qr, nil
}
func (d *Datastore) Close() error {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment