From 24aa3cf632125acb9d4efc1f55da8904280f0e18 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Sat, 3 Aug 2019 00:54:45 +0200 Subject: [PATCH] feature: add selectOne with inique entity parameter --- src/main/kotlin/fr/postgresjson/connexion/Function.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/fr/postgresjson/connexion/Function.kt b/src/main/kotlin/fr/postgresjson/connexion/Function.kt index e7c17f1..ed69eca 100644 --- a/src/main/kotlin/fr/postgresjson/connexion/Function.kt +++ b/src/main/kotlin/fr/postgresjson/connexion/Function.kt @@ -32,6 +32,12 @@ class Function(val definition: Function, override val connection: Connection): E ): R? = select(object: TypeReference() {}, values, block) + inline fun > selectOne( + value: R, + noinline block: SelectOneCallback = {} + ): R? = + select(object: TypeReference() {}, listOf(value), block) + /** * Select One entity with named parameters */