api-docs / org.ktorm.entity / take
take
fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.take(
n: Int
): EntitySequence<E, T>
(source code)Returns a sequence containing first n elements.
Note that this function is implemented based on the pagination feature of the specific databases. It’s known that
there is a uniform standard for SQL language, but the SQL standard doesn’t say how to implement paging queries,
different databases provide different implementations on that. So we have to enable a dialect if we need to use this
function, otherwise an exception will be thrown.
The operation is intermediate.