use sendQuery if no return is expected

This commit is contained in:
2019-08-04 21:09:24 +02:00
parent cbb86dacc5
commit 24349fc71f
12 changed files with 101 additions and 16 deletions

View File

@@ -169,12 +169,22 @@ class Function(val definition: Function, override val connection: Connection): E
return connection.exec(sql, values)
}
override fun sendQuery(values: List<Any?>): Int {
exec(values)
return 0
}
override fun sendQuery(values: Map<String, Any?>): Int {
exec(values)
return 0
}
private fun compileArgs(values: List<Any?>): String {
val placeholders = values
.filterIndexed { index, any ->
definition.parameters[index].default === null || any !== null
.filterIndexed { index, value ->
definition.parameters[index].default === null || value != null
}
.mapIndexed { index, any ->
.mapIndexed { index, _ ->
"?::" + definition.parameters[index].type
}