Skip to content

Support for where conditions with tuples of values #161

Description

@YarekTyshchenko

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)"
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions