hugsql

2017-12-27T09:36:54.000087Z

@udit not sure if i understand the question. If ur db engine supports offset and limit you don’t need anything.

admay 2017-12-27T18:45:30.000117Z

@udit, here’s how I use offset and limit.

select * from table
...
group by col
order by other_col desc
--~ (if (:offset params) "offset :offset")
--~ (if (:limit params) "limit :limit")
It’s probably more idiomatic to use while instead of if since there is only a then block, no else

bostonaholic 2017-12-27T18:51:37.000246Z

I think you mean (when ...)

admay 2017-12-27T18:54:26.000127Z

Yeah, my b. Thanks @bostonaholic