I use the following code to request items from a mysql table (The Account class just is a case class representing the database fields)
val res = Queryable[Account].map(_.name)
val db = Database.forURL("jdbc:mysql://localhost:3306/databasename", driver = "com.mysql.jdbc.Driver", user="username", password="password")
val backend = new SlickBackend(MySQLDriver, AnnotationMapper)
db withSession {
val r=backend.toList(res)
println(r.toString)
}
The line
val r=backend.toList(res)
throws the following exception:
[ToolBoxError: reflective typecheck has failed: ambiguous implicit values: both value StringCanBuildFrom in object Predef of type => scala.collection.generic.CanBuildFrom[String,Char,String] and method conforms in object Predef of type [A]=> <:<[A,A] match expected type T]
What could be the reason for it? I'm using Scala 2.10.0-RC1 and Slick 0.11.2.
Here the way the Account class looks like:
@table("account")
case class Account (
@column("ID") id: Long,
...
@column("Name") name: String,
...
)