Packages

trait Column[A] extends (Any, MetaDataItem) ⇒ Either[SqlRequestError, A]

Column mapping

Self Type
Column[A]
Annotations
@implicitNotFound( ... )
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Column
  2. Function2
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(v1: Any, v2: MetaDataItem): Either[SqlRequestError, A]
    Definition Classes
    Function2

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def curried: (Any) ⇒ (MetaDataItem) ⇒ Either[SqlRequestError, A]
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def map[B](f: (A) ⇒ B): Column[B]

    If the column is successfully parsed, then apply the given function on the result.

    If the column is successfully parsed, then apply the given function on the result.

    import anorm.{ Column, SqlParser, SQL }
    
    sealed trait MyEnum
    case object Foo extends MyEnum
    case object Bar extends MyEnum
    
    val myEnumCol: Column[MyEnum] = Column.of[Int].map {
      case 1 => Right(Foo) // `Right` means successful
      case 2 => Right(Bar)
    }
    
    def find(id: String) =
      SQL"SELECT enum_code FROM my_table WHERE id = $id".
        as(SqlParser.scalar(myEnumCol).single)
  14. final def mapResult[B](f: (A) ⇒ Either[SqlRequestError, B]): Column[B]

    If the column is successfully parsed, then apply the given function on the result.

    If the column is successfully parsed, then apply the given function on the result.

    import anorm.{ Column, SqlParser, SQL }
    
    sealed trait MyEnum
    case object Foo extends MyEnum
    case object Bar extends MyEnum
    
    val myEnumCol: Column[MyEnum] = Column.of[Int].mapResult {
      case 1 => Right(Foo) // `Right` means successful
      case 2 => Right(Bar)
      case _ => Left(SqlMappingError("Unexpected"))
    }
    
    def find(id: String) =
      SQL"SELECT enum_code FROM my_table WHERE id = $id".
        as(SqlParser.scalar(myEnumCol).single)
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    Function2 → AnyRef → Any
  20. def tupled: ((Any, MetaDataItem)) ⇒ Either[SqlRequestError, A]
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from (Any, MetaDataItem) ⇒ Either[SqlRequestError, A]

Inherited from AnyRef

Inherited from Any

Ungrouped