Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I print the DDL that is generated by Slick?

Tags:

scala

slick

Given the lifted/FirstExample.scala from GitHub, how would I introduce a println that would print the generated SQL?

I have tried to add a line println(Suppliers.ddl ++ Coffees.ddl), but this gives me no more than the following: scala.slick.lifted.DDL$$anon$1@acccef1

like image 583
user1390113 Avatar asked Jan 21 '13 19:01

user1390113


1 Answers

Eventually I found the answer myself.

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

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

like image 158
user1390113 Avatar answered Nov 11 '22 03:11

user1390113