trait Encoder[A] extends AnyRef
Encoder of Postgres text-format data from Scala types.
- Self Type
- Encoder[A]
- Source
- Encoder.scala
- Alphabetic
- By Inheritance
- Encoder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
encode(a: A): List[Option[String]]
Encode a value of type
A
, yielding a list of Postgres text-formatted strings, lifted toOption
to handleNULL
values.Encode a value of type
A
, yielding a list of Postgres text-formatted strings, lifted toOption
to handleNULL
values. Encoding failures raise unrecoverable errors. -
abstract
def
sql: State[Int, String]
Given an initial parameter index, yield a hunk of sql containing placeholders, and a new index.
-
abstract
def
types: List[Type]
Types of encoded fields, in order.
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[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
contramap[B](f: (B) ⇒ A): Encoder[B]
Contramap inputs from a new type
B
, yielding anEncoder[B]
. -
lazy val
empty: List[Option[String]]
- Attributes
- protected
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
gcontramap[B](implicit ev: Aux[B, A]): Encoder[B]
Adapt this
Encoder
from twiddle-list type A to isomorphic case-class typeB
. -
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
list(n: Int): Encoder[List[A]]
Derive an encoder for a list of size
n
that expands to a comma-separated list of placeholders. -
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()
-
def
oids(ty: Typer): Either[List[(Type, Option[Int])], List[Int]]
Oids of types, or mismatches.
- def opt: Encoder[Option[A]]
-
def
product[B](fb: Encoder[B]): Encoder[(A, B)]
Encoder
is semigroupal: a pair of encoders make a encoder for a pair. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Encoder → AnyRef → Any
-
def
values: Encoder[A]
Derive an equivalent encoder for a row type; i.e., its placeholders will be surrounded by parens.
-
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
- @throws( ... ) @native()
-
def
~[B](fb: Encoder[B]): Encoder[~[A, B]]
Shorthand for
product
.