slick.additions.codegen

Members list

Type members

Classlikes

Base trait for code generators. Code generators are responsible for producing actual code, but many of the details are determined by the TableConfigs and ColumnConfigs produced by the instance of GenerationRules that is passed in.

Base trait for code generators. Code generators are responsible for producing actual code, but many of the details are determined by the TableConfigs and ColumnConfigs produced by the instance of GenerationRules that is passed in.

Attributes

See also
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ColType

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ColType.type
case class ColumnConfig(column: MColumn, tableFieldTerm: Name, modelFieldTerm: Name, scalaType: Type, scalaDefault: Option[Term])

How a database column is to be represented in code

How a database column is to be represented in code

Value parameters

column

the column this is for

modelFieldTerm

the identifier used in the model class

scalaDefault

the default value to provide in the model class

scalaType

the type that will represent data in the column in code

tableFieldTerm

the identifier used in the Slick table definition

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Uses slick-additions-entity Lookup for foreign key fields.

Uses slick-additions-entity Lookup for foreign key fields.

Generated code requires slick-additions-entity.

Attributes

Supertypes
class Object
trait Matchable
class Any

Uses slick-additions EntityTableModule to represent tables. Generates a custom profile object that mixes in AdditionsProfile with an api member that mixes in AdditionsApi.

Uses slick-additions EntityTableModule to represent tables. Generates a custom profile object that mixes in AdditionsProfile with an api member that mixes in AdditionsApi.

Models should be generated with KeylessModelsCodeGenerator.

Generated code requires slick-additions.

Attributes

Supertypes
class Object
trait Matchable
class Any

Generates TableConfigs (and their ColumnConfigs by reading database metadata. Extend this trait directly or indirectly, and override methods freely to customize.

Generates TableConfigs (and their ColumnConfigs by reading database metadata. Extend this trait directly or indirectly, and override methods freely to customize.

The default implementation does not generate code that requires slick-additions, uses camelCase for corresponding snake_case names in the database, and names model classes by appending Row to the camel-cased table name.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Omits the primary key field from generated model classes, unless the primary key isn't a single column.

Omits the primary key field from generated model classes, unless the primary key isn't a single column.

Attributes

Supertypes
class Object
trait Matchable
class Any

Code generator that produces a case class for each table to represent a row in code

Code generator that produces a case class for each table to represent a row in code

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ScalaMetaDsl

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class TableConfig(tableMetadata: TableMetadata, tableClassName: String, modelClassName: String, columns: List[ColumnConfig])

How a database table is to be represented in code

How a database table is to be represented in code

Value parameters

columns

configurations for this table's columns

modelClassName

the name of the model class

tableClassName

the name of the Slick table definition

tableMetadata

the metadata for the table this is for

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class TableMetadata(table: MTable, columns: Seq[MColumn], primaryKeys: Seq[MPrimaryKey], foreignKeys: Seq[MForeignKey])

Information about a table obtained from the Slick JDBC metadata APIs

Information about a table obtained from the Slick JDBC metadata APIs

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Code generator for standard Slick table definitions. The generated code has no dependency on slick-additions.

Code generator for standard Slick table definitions. The generated code has no dependency on slick-additions.

Tables that have more than 22 fields are mapped by simply nesting tuples so that no single tuple has more than 22 elements.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TryExtractor[A](f: String => A)

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def snakeToCamel(s: String): String

Concrete fields

val AsBoolean: TryExtractor[Boolean]
val AsDouble: TryExtractor[Double]
val AsInt: TryExtractor[Int]