package codegen
- Alphabetic
- By Inheritance
- codegen
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait BaseCodeGenerator extends AnyRef
Base trait for code generators.
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.
- See also
- case class ColumnConfig(column: MColumn, tableFieldTerm: Name, modelFieldTerm: Name, scalaType: Type, scalaDefault: Option[Term]) extends Product with Serializable
How a database column is to be represented in code
How a database column is to be represented in code
- column
the column this is for
- tableFieldTerm
the identifier used in the Slick table definition
- modelFieldTerm
the identifier used in the model class
- scalaType
the type that will represent data in the column in code
- scalaDefault
the default value to provide in the model class
- trait EntityGenerationRules extends GenerationRules
Uses
slick-additions-entity
Lookup
for foreign key fields.Uses
slick-additions-entity
Lookup
for foreign key fields.Generated code requires
slick-additions-entity
. - class EntityTableModulesCodeGenerator extends TablesCodeGenerator
Uses
slick-additions
EntityTableModule
to represent tables.Uses
slick-additions
EntityTableModule
to represent tables. Generates a custom profile object that mixes inAdditionsProfile
with anapi
member that mixes inAdditionsApi
.Models should be generated with KeylessModelsCodeGenerator.
Generated code requires
slick-additions
. - trait GenerationRules extends AnyRef
Generates TableConfigs (and their ColumnConfigs by reading database metadata.
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 appendingRow
to the camel-cased table name. - class KeylessModelsCodeGenerator extends ModelsCodeGenerator
Omits the primary key field from generated model classes, unless the primary key isn't a single column.
- class ModelsCodeGenerator extends BaseCodeGenerator
Code generator that produces a case class for each table to represent a row in code
- case class TableConfig(tableMetadata: TableMetadata, tableClassName: String, modelClassName: String, columns: List[ColumnConfig]) extends Product with Serializable
How a database table is to be represented in code
How a database table is to be represented in code
- tableMetadata
the metadata for the table this is for
- tableClassName
the name of the Slick table definition
- modelClassName
the name of the model class
- columns
configurations for this table's columns
- case class TableMetadata(table: MTable, columns: Seq[MColumn], primaryKeys: Seq[MPrimaryKey], foreignKeys: Seq[MForeignKey]) extends Product with Serializable
Information about a table obtained from the Slick JDBC metadata APIs
- class TablesCodeGenerator extends BaseCodeGenerator
Code generator for standard Slick table definitions.
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.
- class TryExtractor[A] extends AnyRef
- implicit final class scalametaDefnClassExtensionMethods extends AnyVal
Value Members
- val AsBoolean: TryExtractor[Boolean]
- val AsDouble: TryExtractor[Double]
- val AsInt: TryExtractor[Int]
- def snakeToCamel(s: String): String
- object ColType