package fr.postgresjson.connexion import com.fasterxml.jackson.core.type.TypeReference import com.github.jasync.sql.db.QueryResult import kotlin.jvm.Throws sealed interface EmbedExecutable : Executable { val connection: Connection override fun toString(): String val name: String /** * Select with unnamed parameters */ @Throws(DataNotFoundException::class) fun execute( typeReference: TypeReference, values: List, block: SelectCallback = {} ): R? /** * Select with named parameters */ @Throws(DataNotFoundException::class) fun execute( typeReference: TypeReference, values: Map, block: SelectCallback = {} ): R? /** * Select with named parameters */ @Throws(DataNotFoundException::class) fun execute( typeReference: TypeReference, vararg values: Pair, block: SelectCallback = {} ): R? = execute(typeReference, values.toMap(), block) fun exec(values: List): QueryResult fun exec(values: Map): QueryResult fun exec(vararg values: Pair): QueryResult = exec(values.toMap()) }