Move ITs to common files, call from both DBs

- Fix PostgreSQL auto-number syntax
This commit is contained in:
2025-02-26 23:24:02 -05:00
parent 7f3392f004
commit b2d700e658
15 changed files with 378 additions and 186 deletions

View File

@@ -47,7 +47,7 @@ object Parameters {
* @return The query, with name parameters changed to `?`s
*/
fun replaceNamesInQuery(query: String, parameters: Collection<Parameter<*>>) =
parameters.sortedByDescending { it.name.length }.fold(query) { acc, param -> acc.replace(param.name, "?") }
parameters.sortedByDescending { it.name.length }.fold(query) { acc, param -> acc.replace(param.name, "?") }.also(::println)
/**
* Apply the given parameters to the given query, returning a prepared statement
@@ -103,7 +103,7 @@ object Parameters {
}
}
ParameterType.JSON -> stmt.setString(idx, param.value as String)
ParameterType.JSON -> stmt.setObject(idx, param.value as String, Types.OTHER)
}
}
}