JdbcModelBuilder

slick.jdbc.JdbcModelBuilder
class JdbcModelBuilder(mTables: Seq[MTable], ignoreInvalidDefaults: Boolean)(implicit ec: ExecutionContext) extends Logging

Build a Slick model from introspecting the JDBC metadata.

In most cases you are better off transforming the generated model instead of overriding functionality here. It is only useful if you need easy access to the JDBC metadata in order to influence how the model is generated. A good use case would be interpreting column types or default values that Slick doesn't understand out of the box. If you just want to remove or hard code some default values, transform the resulting model instead.

The tight coupling can easily lead to source code incompatibilities in future versions. Avoid hooking in here if you don't have to.

Attributes

ignoreInvalidDefaults

see JdbcModelBuilder#ColumnBuilder#default

Source:
JdbcModelBuilder.scala
Graph
Supertypes
trait Logging
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Basic customization overrides

class ColumnBuilder(tableBuilder: TableBuilder, meta: MColumn)

Column model builder.

Column model builder.

Attributes

Source:
JdbcModelBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TableBuilder(val meta: MTable, val namer: TableNamer, val mColumns: Seq[MColumn], val mPrimaryKeys: Seq[MPrimaryKey], val mForeignKeys: Seq[Seq[MForeignKey]], val mIndices: Seq[Seq[MIndexInfo]])

Table model builder

Table model builder

Attributes

Source:
JdbcModelBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Column model builder factory. Override for customization.

Column model builder factory. Override for customization.

Attributes

Source:
JdbcModelBuilder.scala

Table model builder factory. Override for customization.

Table model builder factory. Override for customization.

Attributes

Source:
JdbcModelBuilder.scala

Type members

Classlikes

class Builders(val tablesByQName: Map[MQName, TableBuilder])

Attributes

Source:
JdbcModelBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
class ForeignKeyBuilder(tableBuilder: TableBuilder, meta: Seq[MForeignKey])

Attributes

Source:
JdbcModelBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
class IndexBuilder(tableBuilder: TableBuilder, meta: Seq[MIndexInfo])

Attributes

Source:
JdbcModelBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class PrimaryKeyBuilder(tableBuilder: TableBuilder, meta: Seq[MPrimaryKey])

Attributes

Source:
JdbcModelBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TableNamer(val meta: MTable)

Attributes

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

Value members

Concrete methods

Creates a Slick data model from jdbc meta data. Foreign keys pointing out of the given tables are not included.

Creates a Slick data model from jdbc meta data. Foreign keys pointing out of the given tables are not included.

Attributes

Source:
JdbcModelBuilder.scala
def createBuilders(tablesByQName: Map[MQName, TableBuilder]): Builders

Attributes

Source:
JdbcModelBuilder.scala
def createIndexBuilder(tableBuilder: TableBuilder, meta: Seq[MIndexInfo]): IndexBuilder

Attributes

Source:
JdbcModelBuilder.scala
def jdbcTypeToScala(jdbcType: Int, typeName: String): ClassTag[_]

Converts from java.sql.Types w/ type name to the corresponding Java class name (with fully qualified path).

Converts from java.sql.Types w/ type name to the corresponding Java class name (with fully qualified path).

Attributes

Source:
JdbcModelBuilder.scala
def readColumns(t: MTable): DBIO[Vector[MColumn]]

Read the column metadata for a table in ordinal position order

Read the column metadata for a table in ordinal position order

Attributes

Source:
JdbcModelBuilder.scala

Read the foreign key metadata for a table grouped by name and in key sequence order

Read the foreign key metadata for a table grouped by name and in key sequence order

Attributes

Source:
JdbcModelBuilder.scala
def readIndices(t: MTable): DBIO[Seq[Seq[MIndexInfo]]]

Read the index metadata grouped by name and in ordinal position order

Read the index metadata grouped by name and in ordinal position order

Attributes

Source:
JdbcModelBuilder.scala

Read the primary key metadata for a table in key sequence order

Read the primary key metadata for a table in key sequence order

Attributes

Source:
JdbcModelBuilder.scala

Concrete fields

lazy val tableNamers: Seq[TableNamer]

Attributes

Source:
JdbcModelBuilder.scala