Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for where conditions with tuples of values #161

Open
YarekTyshchenko opened this issue Nov 1, 2019 · 0 comments
Open

Support for where conditions with tuples of values #161

YarekTyshchenko opened this issue Nov 1, 2019 · 0 comments

Comments

@YarekTyshchenko
Copy link

Postgres supports syntax like this: ... WHERE (a, b) in ((1, 2), (3, 4))
It would be nice to pass Seq of Tuple (or even a case class) as a Param in the query, currently it seems to only work with String.

A test for something like this (for sql"" syntax) might look something like this:

"Seq of tuple params for IN operator" in {
  val p1 = Seq(("foo", "bar"), ("three", "four"))
  expectQuery("SELECT * FROM foo WHERE (a, b) IN (($1, $2), ($3, $4))", "foo", "bar", "three", "four") {
    sql"SELECT * FROM foo WHERE a IN ($p1)"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant