score:2

you can try this:

import play.api.db.slick.config.driver.simple._
import scala.slick.lifted.tag

case class coordinate(val x: int, val y: int)

class mytable(val tag: tag) extends table[(coordinate, string)](tag, "coordinates") {
  def x = column[int]("x")
  def y = column[int]("y")
  def data = column[string]("data")

  def * = (x, y, data).shaped <> ({
    case (x, y, data) => (coordinate(x, y), data)
  }, { ct: tuple2[coordinate, string] =>
    some(ct._1.x, ct._1.y, ct._2)
  })
}

object coordinates {

  val mytable = tablequery[mytable]

  def insert(ct: (coordinate, string))(implicit session: session) = {
    mytable.insert(ct)
  }

  def search(x: int, y: int)(implicit session: session): option[(coordinate, string)] = {
    mytable.where(_.x === x).where(_.y === y).firstoption
  }

}

Related Query

More Query from same tag