diff options
author | krrrr38 <k.kaizu38@gmail.com> | 2015-08-09 21:42:53 +0900 |
---|---|---|
committer | krrrr38 <k.kaizu38@gmail.com> | 2015-08-09 22:33:15 +0900 |
commit | 76ee13c8818bb386ba94a5c02037deb0ed7046c9 (patch) | |
tree | 17e63ee59ff1f218e0692cd414a3d1b31a2930f1 /src/main/scala/Example.scala | |
parent | b40dfa417eaf77216ebe5df7d2a80dd6f521dd02 (diff) | |
download | slick-codegen-example-76ee13c8818bb386ba94a5c02037deb0ed7046c9.tar.gz slick-codegen-example-76ee13c8818bb386ba94a5c02037deb0ed7046c9.tar.bz2 slick-codegen-example-76ee13c8818bb386ba94a5c02037deb0ed7046c9.zip |
Update build for 3.0.1
Diffstat (limited to 'src/main/scala/Example.scala')
-rw-r--r-- | src/main/scala/Example.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/scala/Example.scala b/src/main/scala/Example.scala index ffa964b..3eaf9d3 100644 --- a/src/main/scala/Example.scala +++ b/src/main/scala/Example.scala @@ -2,7 +2,8 @@ object Tables extends{ // or just use object demo.Tables, which is hard-wired to val profile = scala.slick.driver.H2Driver
} with demo.Tables
import Tables._
-import Tables.profile.simple._
+import Tables.profile.api._
+import scala.concurrent.ExecutionContext.Implicits.global
object Example extends App {
// connection info for a pre-populated throw-away, in-memory db for this demo, which is freshly initialized on every run
@@ -13,8 +14,8 @@ object Example extends App { val q = Companies.join(Computers).on(_.id === _.manufacturerId)
.map{ case (co,cp) => (co.name, cp.name) }
- db.withTransaction { implicit session =>
- println( q.run.groupBy{ case (co,cp) => co }
+ db.run(q.result).foreach { result =>
+ println(result.groupBy{ case (co,cp) => co }
.mapValues(_.map{ case (co,cp) => cp })
.mkString("\n")
)
|