How to print DDL created by Slick?

Given lifted / FirstExample.scala from GitHub, how would I imagine printlnwhich will print the generated SQL?

I tried adding a line println(Suppliers.ddl ++ Coffees.ddl), but that gives me no more than the following: scala.slick.lifted.DDL $$ Anon $ 1 @ acccef1

+5
source share
1 answer

In the end, I myself found the answer.

    (Suppliers.ddl ++ Coffees.ddl).createStatements.foreach(println)

More information can be found in ScalaDoc: http://slick.typesafe.com/doc/1.0.0-RC1/api/#scala.slick.lifted.DDL

+8
source

All Articles