1

I have a query which gives a result as

org.scalaquery.ql.Query[(java.lang.String, Int, java.lang.String)] 

What I need to do is to convert above query to a data list as follows

List[(String,Int,String)]

please give me a way to do this conversion in scalaquery.

Francisco Canedo
  • 1,980
  • 2
  • 13
  • 16
tiran
  • 2,389
  • 1
  • 16
  • 28

1 Answers1

1

Once you define your query, you can simply call list on it, within a session:

val q = for (e <- Entities) yield e.*
db.withSession { session: Session => q.list()(session) }

See the docs for more info: https://github.com/szeiger/scala-query/wiki/Queries

Francisco Canedo
  • 1,980
  • 2
  • 13
  • 16