RowHelpers
doobie.TableDefinition.RowHelpers
Helper that allows you to quickly get some of the queries for the table.
You should put this on the companion object of the row.
Example:
object Cars extends TableDefinition("cars") {
val idCol = Column[Long]("id")
val makeCol = Column[String]("make")
case class Row(id: Long, make: String)
object Row extends WithSQLDefinition[Row](
Composite((idCol.sqlDef, makeCol.sqlDef))(Row.apply)(Tuple.fromProductTyped)
) with TableDefinition.RowHelpers[Row](this)
}
Type parameters
- TRow
-
the type of the row.
Attributes
- Source
- TableDefinition.scala
- Graph
-
- Supertypes
- Self type
-
SQLDefinition[TRow]
Members list
In this article