From b5eac3778211b1a6728871c71f364c3a80b812de Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 20 Apr 2022 18:36:36 +0600 Subject: [PATCH] improvements in ExposedCRUDRepo --- CHANGELOG.md | 4 ++++ .../dev/inmo/micro_utils/repos/exposed/ExposedCRUDRepo.kt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45fee4d96f4..0db2cd8bd77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.9.23 +* `Repos`: + * `Exposed`: + * New property `ExposedCRUDRepo#selectAll` to retrieve all the rows in the table + ## 0.9.22 * `Ktor`: diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedCRUDRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedCRUDRepo.kt index a7505f5e727..87f812cf8f2 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedCRUDRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/ExposedCRUDRepo.kt @@ -5,4 +5,6 @@ import org.jetbrains.exposed.sql.* interface ExposedCRUDRepo : ExposedRepo { val ResultRow.asObject: ObjectType val selectById: SqlExpressionBuilder.(IdType) -> Op + val selectAll: Transaction.() -> Query + get() = { (this as FieldSet).selectAll() } }