Move ITs to common files, call from both DBs
- Fix PostgreSQL auto-number syntax
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user