Made the select pageable

Sorry, I don't know scala so I coded like java. I made just a small change to optionally make the select statement able to page with LIMIT and OFFSET. This was trivial as MySQL and PostgreSQL share the same syntax.