Columns

doobie.Columns
See theColumns companion object
case class Columns[QueryResult] extends TypedMultiFragment[QueryResult]

Allows you to select columns in a type-safe way.

Example:

 val columns = Columns((nameCol.tmf, ageCol.tmf, pet1Col.tmf, pet2Col.tmf))
 val resultQuery: Query0[(String, Int, String, Option[String])] =
   sql"SELECT $columns FROM $personWithPetsTable".queryOf(columns)

Type parameters

QueryResult

the type of Fragment.queryOf(columns) expression.

Value parameters

sql

returns the names of the columns, for example "name, surname, age".

Attributes

Companion
object
Source
Columns.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait TypedMultiFragment[QueryResult]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def fragment: Fragment

Attributes

Definition Classes
Source
Columns.scala
def map[QueryResult2](f: QueryResult => QueryResult2): Columns[QueryResult2]

Attributes

Source
Columns.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
inline def tmf: TypedMultiFragment[QueryResult]

To allow widening the type of Column and similar ones to TypedMultiFragment.

To allow widening the type of Column and similar ones to TypedMultiFragment.

This is useful when working with tuples of TypedMultiFragments, because (Column[Int], Column[String]) is not the same thing as (TypedMultiFragment[Int], TypedMultiFragment[String]).

Attributes

Inherited from:
TypedMultiFragment
Source
TypedMultiFragment.scala