Why does that make sense?
Consider the following code which got myself confused for some time:
import scala.slick.driver.H2Driver.simple._ // [..] val dict = TableQuery[Dict] // [..] // Create the dictionary table and insert some data dict.ddl.create
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:
implicit def tableQueryToTableQueryExtensionMethods [T <: Table[_], U](q: Query[T, U, Seq] with TableQuery[T]) = new TableQueryExtensionMethods[T, U](q)
This allows the execution of line
From the example above.
- Where is the .ddl method defined in Slick's Scaladoc
- Where is the scaladoc for scala.language.existentials?
- Where is the method that boxes an AnyRef into an Option?
- Where is Scala's += defined in the context of Int?
- Where does scaladoc look for the rootdoc.txt to create the root doc
- Where are the implicit conversions between Numeric and Double defined in Scala 2.9
- shapeless implicit val LabelledGeneric cannot found in method where case class is defined
- Mockito: Mocking method that is not yet defined but know the return type
- Where is the `++=` operator defined for a scala immutable list?
- Where is the string operator " <- " defined in Scala?
- Scala: Which implicit parameter takes priority? The one declared where a method is defined? Or where the method is called?
- What's the scope of a private top-level class with access qualifier set to the same package where the class is defined in Scala?
- Obtain the field member of the class where the macro is defined in
- Where does Manifest in the implicit method parameter list ome from?
- Where are the internal error pages defined
- Where is the apply method in the docs, for Scala collection factory objects?
- where is the main method in the sbt source code?
- Access a constant from the companion class inside a method defined in a trait
- where is scala get() method been defined
- Ambiguous identifier in Scala: Where is this defined in the SLS?
- Why Scala case class copy method parameterised only with the variables defined in the case class?
- Where does the "flatmap that s***" idiomatic expression in Scala come from?
- When to use the equals sign in a Scala method declaration?
- What is the rule for parenthesis in Scala method invocation?
- Why won't the Scala compiler apply tail call optimization unless a method is final?
- Scala macros and the JVM's method size limit
- Why can't a class extend traits with method of the same signature?
- Running a method after the constructor of any derived class
- How does Scala's equals method work in the case of a List?
- Calling a method on the superclass in a self-typed trait in scala
More Query from same tag
- Why is the return type of the fold operation Serializable and not String
- java.util.concurrent.RejectedExecutionException in Spark although driver/client has precisely same version as Server
- Generic routing
- Prefix column with zeroes in spark
- Scala: lightweight way to put Arrays in a Set or Map
- Is there a 'partial reduce' function in Scala?
- Spring-Boot: How can I build a runnable jar with SBT?
- How can I sort List[Int] objects?
- Typesafe Config overriding values from external file
- Manually validate a text
- How to read in scala a long number that was packed in python
- Scala and UnionTypes bound to a generic type
- Access to dynamic Images with vue and playframework
- Scala Syntax Specification mismatch if-else with one line expression end by semicolon?
- Insert blank page in pdf with OpenPdf
- How Scala distinguishes between unary operators and characters in variable name
- Universal copy function as a Macro
- How do I correctly use DI to inject a Play controller's constructor?
- How to generate consecutive unique ids for successive data frame's column generated across successive runs
- In scala, how to pattern match against an inlined expression?
- Localhost vs cname give different results
- Creating Map[String, Map[String, Object]] from List[Object]
- How to match on unknown generic type without warnings
- Overwriting ML model in S3 bucket
- Java Transport Client for Elasticsearch throws NoNodeAvailableException
- Scala Generics and Numeric Implicits
- H2 database automatically trying to create itself in Slick
- Unable to use caching at model level
- How to automate the creation of String elements with datetime