trait Codec[A] extends Encoder[A] with Decoder[A]
Symmetric encoder and decoder of Postgres text-format data to and from Scala types.
- Self Type
- Codec[A]
- Source
- Codec.scala
- Alphabetic
- By Inheritance
- Codec
- Decoder
- Encoder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
decode(offset: Int, ss: List[Option[String]]): Either[Error, A]
- Definition Classes
- Decoder
-
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.- Definition Classes
- Encoder
-
abstract
def
sql: State[Int, String]
Given an initial parameter index, yield a hunk of sql containing placeholders, and a new index.
Given an initial parameter index, yield a hunk of sql containing placeholders, and a new index.
- Definition Classes
- Encoder
-
abstract
def
types: List[Type]
- Definition Classes
- Decoder
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
-
def
asDecoder: Decoder[A]
Forget this value is a
Codec
and treat it as aDecoder
. -
def
asEncoder: Encoder[A]
Forget this value is a
Codec
and treat it as anEncoder
. -
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]
.Contramap inputs from a new type
B
, yielding anEncoder[B]
.- Definition Classes
- Encoder
-
lazy val
empty: List[Option[String]]
- Attributes
- protected
- Definition Classes
- Encoder
-
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
.Adapt this
Encoder
from twiddle-list type A to isomorphic case-class typeB
.- Definition Classes
- Encoder
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
gimap[B](implicit ev: Aux[B, A]): Codec[B]
Adapt this
Codec
from twiddle-list type A to isomorphic case-class typeB
. -
def
gmap[B](implicit ev: Aux[B, A]): Decoder[B]
Adapt this
Decoder
from twiddle-list type A to isomorphic case-class typeB
.Adapt this
Decoder
from twiddle-list type A to isomorphic case-class typeB
.- Definition Classes
- Decoder
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
imap[B](f: (A) ⇒ B)(g: (B) ⇒ A): Codec[B]
Contramap inputs from, and map outputs to, a new type
B
, yielding aCodec[B]
. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
length: Int
- Definition Classes
- Decoder
-
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.Derive an encoder for a list of size
n
that expands to a comma-separated list of placeholders.- Definition Classes
- Encoder
-
def
map[B](f: (A) ⇒ B): Decoder[B]
Map decoded results to a new type
B
, yielding aDecoder[B]
.Map decoded results to a new type
B
, yielding aDecoder[B]
.- Definition Classes
- Decoder
-
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.
Oids of types, or mismatches.
- Definition Classes
- Encoder
-
def
opt: Codec[Option[A]]
Lift this
Codec
intoOption
, whereNone
is mapped to and from a vector ofNULL
. -
def
product[B](fb: Codec[B]): Codec[(A, B)]
Codec
is semigroupal: a pair of codecs make a codec for a pair. -
def
product[B](fb: Decoder[B]): Decoder[(A, B)]
Decoder
is semigroupal: a pair of decoders make a decoder for a pair.Decoder
is semigroupal: a pair of decoders make a decoder for a pair.- Definition Classes
- Decoder
-
def
product[B](fb: Encoder[B]): Encoder[(A, B)]
Encoder
is semigroupal: a pair of encoders make a encoder for a pair.Encoder
is semigroupal: a pair of encoders make a encoder for a pair.- Definition Classes
- Encoder
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toString(): String
-
def
values: Encoder[A]
Derive an equivalent encoder for a row type; i.e., its placeholders will be surrounded by parens.
Derive an equivalent encoder for a row type; i.e., its placeholders will be surrounded by parens.
- Definition Classes
- Encoder
-
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: Codec[B]): Codec[~[A, B]]
Shorthand for
product
. -
def
~[B](fb: Decoder[B]): Decoder[~[A, B]]
Shorthand for
product
.Shorthand for
product
.- Definition Classes
- Decoder
-
def
~[B](fb: Encoder[B]): Encoder[~[A, B]]
Shorthand for
product
.Shorthand for
product
.- Definition Classes
- Encoder