OutputHelpers

slick.codegen.OutputHelpers

Output-related code-generation utilities.

Attributes

Source
OutputHelpers.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Grouped members

Basic customization overrides

def packageCode(profile: String, pkg: String, container: String, parentType: Option[String]): String

Generates code providing the data model as trait and object in a Scala package

Generates code providing the data model as trait and object in a Scala package

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

pkg

Scala package the generated code is placed in

profile

Slick profile that is imported in the generated package (e.g. slick.jdbc.H2Profile)

Attributes

Source
OutputHelpers.scala
def packageContainerCode(profile: String, pkg: String, container: String): String

Generates code providing the stand-alone slick data model for immediate use.

Generates code providing the stand-alone slick data model for immediate use.

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

pkg

Scala package the generated code is placed in

profile

Slick profile that is imported in the generated package (e.g. scala.slick.driver.H2Driver)

Attributes

Source
OutputHelpers.scala
def packageTableCode(tableName: String, tableCode: String, pkg: String, container: String): String

Generates code for the given table. The tableName and tableCode parameters should come from the #codePerTable map.

Generates code for the given table. The tableName and tableCode parameters should come from the #codePerTable map.

Value parameters

container

The name of the container

pkg

Scala package the generated code is placed in

tableCode

: the generated code for the table.

tableName

: the name of the table

Attributes

Source
OutputHelpers.scala

Output

def writeStringToFile(content: String, folder: String, pkg: String, fileName: String): Unit

Writes given content to a file. Ensures the file ends with a newline character.

Writes given content to a file. Ensures the file ends with a newline character.

Attributes

Source
OutputHelpers.scala
def writeToFile(profile: String, folder: String, pkg: String, container: String, fileName: String): Unit

Generates code and writes it to a file. Creates a folder structure for the given package inside the given srcFolder and places the new file inside or overrides the existing one.

Generates code and writes it to a file. Creates a folder structure for the given package inside the given srcFolder and places the new file inside or overrides the existing one.

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

fileName

Name of the output file, to which the code will be written

folder

target folder, in which the package structure folders are placed

pkg

Scala package the generated code is placed in (a subfolder structure will be created within srcFolder)

profile

Slick profile that is imported in the generated package (e.g. slick.jdbc.H2Profile)

Attributes

Source
OutputHelpers.scala
def writeToMultipleFiles(profile: String, folder: String, pkg: String, container: String): Unit

Generates code and writes it to multiple files. Creates a folder structure for the given package inside the given srcFolder and places the new files inside or overrides the existing one.

Generates code and writes it to multiple files. Creates a folder structure for the given package inside the given srcFolder and places the new files inside or overrides the existing one.

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

folder

target folder, in which the output files are placed

pkg

Scala package the generated code is placed in (a subfolder structure will be created within srcFolder)

profile

Slick profile that is imported in the generated package (e.g. scala.slick.driver.H2Driver)

Attributes

Source
OutputHelpers.scala

Value members

Abstract methods

def code: String

Attributes

Source
OutputHelpers.scala
def codeForContainer: String

The generated code used to generate the container class.

The generated code used to generate the container class.

Attributes

Source
OutputHelpers.scala
def codePerTable: Map[String, String]

The generated code stored in a map that associates the scala filename with the generated code (this map contains one entry per table).

The generated code stored in a map that associates the scala filename with the generated code (this map contains one entry per table).

Attributes

Source
OutputHelpers.scala
def foreignKeysPerTable: Map[String, List[String]]

Foreign keys used for mapping a minimal set of dependencies between tables.

Foreign keys used for mapping a minimal set of dependencies between tables.

Attributes

Source
OutputHelpers.scala
def indent(code: String): String

Indents all but the first line of the given string No indent is added to empty lines.

Indents all but the first line of the given string No indent is added to empty lines.

Attributes

Source
OutputHelpers.scala

Concrete methods

def parentType: Option[String]

The parent type of the generated main trait. This can be overridden in subclasses.

The parent type of the generated main trait. This can be overridden in subclasses.

Attributes

Source
OutputHelpers.scala
def rootTraitCode(profile: String, pkg: String, container: String): String

Attributes

Source
OutputHelpers.scala