scala-cass icon indicating copy to clipboard operation
scala-cass copied to clipboard

support IN operator in WHERE clause of SELECT

Open thurstonsand opened this issue 8 years ago • 0 comments

specifics: http://docs.datastax.com/en/cql/3.1/cql/cql_reference/select_r.html?scroll=reference_ds_d35_v2q_xj__selectIN

ideas:

  1. predefined case class that takes a type parameter and takes a List as parameter. easy to implement, but cumbersome to use
case class PredefinedIn[T](l: List[T])
case class MyTable(str: String)
case class MyQuery(str: PredefinedIn[String])
ss.select("mytable", MyQuery(PredefinedIn(List("a", "b", "c"))))

1a) implicit conversion for magical convenience? easier to use, but can people figure out what's happening?

case class MyQuery(str: PredefinedIn[String])
implicit def normal2Predefined[T](l: List[T]): PredefinedIn[T] = PredefinedIn[T](l)
ss.select("mytable", MyQuery(List("a", "b", "c"))

thurstonsand avatar Jul 26 '16 19:07 thurstonsand