WIP on query tests

This commit is contained in:
2025-02-18 17:54:18 -05:00
parent 0b11b803cc
commit 2b6dff9fd3
6 changed files with 173 additions and 50 deletions

View File

@@ -21,7 +21,11 @@ object Parameters {
fun nameFields(fields: Collection<Field<*>>): Collection<Field<*>> {
val name = ParameterName()
return fields.map {
if (it.name.isBlank()) it.withParameterName(name.derive(null)) else it
if (it.parameterName.isNullOrEmpty() && !listOf(Op.EXISTS, Op.NOT_EXISTS).contains(it.comparison.op)) {
it.withParameterName(name.derive(null))
} else {
it
}
}
}
@@ -75,7 +79,8 @@ object Parameters {
is Int -> stmt.setInt(idx, param.value)
is Long -> stmt.setLong(idx, param.value)
else -> throw DocumentException(
"Number parameter must be Byte, Short, Int, or Long (${param.value::class.simpleName})")
"Number parameter must be Byte, Short, Int, or Long " +
"(${param.value::class.simpleName})")
}
}
ParameterType.STRING -> {