trait Column[A] extends (Any, MetaDataItem) ⇒ Either[SqlRequestError, A]
Ordering
- Alphabetic
- By Inheritance
Inherited
- Column
- Function2
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
-
abstract
def
apply(v1: Any, v2: MetaDataItem): Either[SqlRequestError, A]
- Definition Classes
- Function2
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
curried: (Any) ⇒ (MetaDataItem) ⇒ Either[SqlRequestError, A]
- Definition Classes
- Function2
- Annotations
- @unspecialized()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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)
-
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)
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function2 → AnyRef → Any
-
def
tupled: ((Any, MetaDataItem)) ⇒ Either[SqlRequestError, A]
- Definition Classes
- Function2
- Annotations
- @unspecialized()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )