You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In MySQL the IN operator allows you to determine if a value matches any value in a list of values.
Unfortunately there is currently no support vor passing a list as a query parameter
This works
fun testSelect(): List<String> {
val sql = """
SELECT column_1, column_2 FROM TEST_TABLE WHERE column_1 IN ('a', 'b')
""".trimIndent()
val query = queryOf(sql).map { row -> row.string("column_2") }.asList
return scanappDb.useConnection { dbSession ->
dbSession.run(query)
}
}
This doesn't work
fun testSelect2(): List<String> {
val sql = """
SELECT column_1, column_2 FROM TEST_TABLE WHERE column_1 IN :values
""".trimIndent()
val query = queryOf(sql, mapOf("values" to arrayOf("a", "b")))
.map { row -> row.string("column_2") }.asList
return scanappDb.useConnection { dbSession ->
dbSession.run(query)
}
}
Hey @MaaxGr, thanks for writing in! Unfortunately, I myself do not have enough time to work on this project (in my spare time). If you are interested in making pull requests for it, I'm happy to be a reviewer and, if the change looks great, I'm happy to have the change in the next release.
Hi seratch,
thx for your answer! Unfortunately i don't have that much spare time to dive deep into unfamiliar code bases at the moment as well. 😅
I will look into it and see what i can do. But if someone else is interested in contributing, feel free.
Activity
seratch commentedon Sep 1, 2021
Hey @MaaxGr, thanks for writing in! Unfortunately, I myself do not have enough time to work on this project (in my spare time). If you are interested in making pull requests for it, I'm happy to be a reviewer and, if the change looks great, I'm happy to have the change in the next release.
seratch commentedon Sep 1, 2021
#17 may be related
MaaxGr commentedon Sep 1, 2021
Hi seratch,
thx for your answer! Unfortunately i don't have that much spare time to dive deep into unfamiliar code bases at the moment as well. 😅
I will look into it and see what i can do. But if someone else is interested in contributing, feel free.
Regards Max