AliasedTableDefinition

doobie.AliasedTableDefinition
case class AliasedTableDefinition[T <: TableDefinition](name: Fragment, alias: String, original: T) extends TableName

Result of TableDefinition.as.

Value parameters

alias

the alias of the table, for example "u".

name

the name of the table with the alias, for example "users AS u".

original

the original TableDefinition.

Attributes

Source
TableDefinition.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait TableName
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

alias as a Fragment.

alias as a Fragment.

Attributes

Source
TableDefinition.scala
def apply[A](f: T => SQLDefinition[A]): SQLDefinition[A]

Allows you to prefix column names with the alias in the SQL definitions.

Allows you to prefix column names with the alias in the SQL definitions.

Example:

 val u = tables.Users as "u"
 u.c(_.complexSqlDefinition).sql == sql"u.name, u.surname, u.age"

Attributes

Source
TableDefinition.scala
def c[A](f: T => Column[A]): Column[A]

Allows you to prefix column names with the alias in the SQL definitions.

Allows you to prefix column names with the alias in the SQL definitions.

c stands for column.

Example:

 val u = tables.Users as "u"
 u.c(_.id).name == sql"u.${u.original.id.name}"

Attributes

Source
TableDefinition.scala
inline def o: T

Shorthand for original.

Shorthand for original.

Attributes

Source
TableDefinition.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product