I have figured out for creating a Postgres table, I need to have this import line
import slick.driver.PostgresDriver.simple._
However, when I go an look at the Scaladoc for SimpleQL, I cannot find a method for ddl
, am I looking in the wrong place? This is really an exercise for me navigating Scaladocs. I can see that TableQuery
is aliased, but I do not see any extra methods added to it.
TLDR: Where is the ddl
method defined at in Slick 2.1.0's scala docs?
The definition of method ddl is included in the description of classes TableQueryExtensionMethods and Sequence. It can be found, for example, via Scaladoc's index.
Why does that make sense?
Consider the following code which got myself confused for some time:
First, note that the import in given example is very similar to the one in the question. I just use a different database.
Method ddl is applied to a value of type
TableQuery[Dict]
although class TableQuery obviously does not contain this method.Instead, it was shown that class TableQueryExtensionMethods contains this method.
The implementation of class TableQueryExtensionMethods shows that Slick's developers make use of an implicit Conversion from TableQuery to TableQueryExtensionMethods:
This allows the execution of line
From the example above.