Made the select pageable

Sorry, I son'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.