Encoder

skunk.Encoder
See theEncoder companion object
trait Encoder[A]

Encoder of Postgres text-format data from Scala types.

Attributes

Companion
object
Source
Encoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Codec[A]
Self type
Encoder[A]

Members list

Value members

Abstract methods

def encode(a: A): List[Option[Encoded]]

Encode a value of type A, yielding a list of Postgres text-formatted strings, lifted to Option to handle NULL values.

Encode a value of type A, yielding a list of Postgres text-formatted strings, lifted to Option to handle NULL values. Encoding failures raise unrecoverable errors.

Attributes

Source
Encoder.scala
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.

Attributes

Source
Encoder.scala
def types: List[Type]

Types of encoded fields, in order.

Types of encoded fields, in order.

Attributes

Source
Encoder.scala

Concrete methods

def contramap[B](f: B => A): Encoder[B]

Contramap inputs from a new type B, yielding an Encoder[B].

Contramap inputs from a new type B, yielding an Encoder[B].

Attributes

Source
Encoder.scala
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.

Attributes

Source
Encoder.scala
def list(as: List[A]): Encoder[List[A]]

Derive an encoder for the specified list.

Derive an encoder for the specified list. This is equivalent to list(as.length) but the resulting encoder can only encode the exact list that it was passed. Prefer this overload when possible because it lessens the possibility of attempting to encode a list of the wrong length.

Attributes

Source
Encoder.scala
def oids(ty: Typer): Either[List[(Type, Option[Int])], List[Int]]

Oids of types, or mismatches.

Oids of types, or mismatches.

Attributes

Source
Encoder.scala
def opt: Encoder[Option[A]]

Attributes

Source
Encoder.scala
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.

Attributes

Source
Encoder.scala
def redacted: Encoder[A]

Returns an encoder that redacts encoded values.

Returns an encoder that redacts encoded values.

Attributes

Source
Encoder.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Encoder.scala

Attributes

Source
Encoder.scala
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.

Attributes

Source
Encoder.scala
def ~[B](fb: Encoder[B]): Encoder[(A, B)]

Shorthand for product.

Shorthand for product.

Attributes

Source
Encoder.scala

Deprecated methods

def gcontramap[B](implicit ev: Aux[B, A]): Encoder[B]

Adapt this Encoder from twiddle-list type A to isomorphic case-class type B.

Adapt this Encoder from twiddle-list type A to isomorphic case-class type B.

Attributes

Deprecated
true
Source
Encoder.scala