English | 简体中文

api-docs / org.ktorm.dsl / limit

limit

fun Query.limit(n: Int): Query (source code)

Specify the pagination limit parameter of this query.

This function requires a dialect enabled, different SQLs will be generated with different dialects.

Note that if the number isn’t positive then it will be ignored.

fun Query.limit(offset: Int?, limit: Int?): Query (source code)

Specify the pagination parameters of this query.

This function requires a dialect enabled, different SQLs will be generated with different dialects. For example,
limit ?, ? for MySQL, limit m offset n for PostgreSQL.

Note that if the numbers aren’t positive, they will be ignored.