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 => Column[A]): Column[A]

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 apply[A](f: T => SQLDefinitionRead[A]): SQLDefinitionRead[A]

Attributes

Source
TableDefinition.scala
inline def o: T

Shorthand for original.

Shorthand for original.

Attributes

Source
TableDefinition.scala

Deprecated methods

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

Deprecated
[Since version 0.4.0]
Source
TableDefinition.scala

Inherited methods

def insertInto[F[_]](columns: F[(Fragment, Fragment)])(using Reducible[F], Pos): Fragment

Generates the SQL for INSERT INTO table (column1, column2, ...) VALUES (value1, value2, ...).

Generates the SQL for INSERT INTO table (column1, column2, ...) VALUES (value1, value2, ...).

Example:

 tables.InventoryCharacters.insertInto(NonEmptyVector.of(
   tables.InventoryCharacters.userId --> c.userId,
   tables.InventoryCharacters.guid --> c.guid
 ))

Attributes

Inherited from:
TableName
Source
TableDefinition.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def updateTable(column1: (Fragment, Fragment), other: (Fragment, Fragment)*)(using Pos): Fragment

Overload of updateTable for convenience.

Overload of updateTable for convenience.

Attributes

Inherited from:
TableName
Source
TableDefinition.scala
def updateTable[F[_]](columns: F[(Fragment, Fragment)])(using Reducible[F], Pos): Fragment

Generates the SQL for UPDATE table SET column1 = value1, column2 = value2, ....

Generates the SQL for UPDATE table SET column1 = value1, column2 = value2, ....

Example:

 tables.InventoryCharacters.updateTable(NonEmpty.createVector(
   tables.InventoryCharacters.handgun1 --> loadouts.sets.set1.weapons.handgun,
   tables.InventoryCharacters.handgun2 --> loadouts.sets.set2.weapons.handgun
 ))

Attributes

Inherited from:
TableName
Source
TableDefinition.scala