seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
768 stars 90 forks source link

Add support for top/limit/offset to friendly SQL functions #124

Closed seancorfield closed 4 years ago

seancorfield commented 4 years ago

OFFSET n ROWS FETCH NEXT n ROWS ONLY seems to be fairly standard so supporting :offset and :fetch seems reasonable in for-query.

SELECT TOP n is specific to SQL Server I believe but supporting :top is not confusing, and it's easy.

LIMIT ? OFFSET ? is supported by MySQL and PostgreSQL (which also supports the offset/fetch syntax above) so supporting :limit is also worthwhile (and the presence of :limit would determine which :offset syntax to use).