object ValueReads
- Alphabetic
- By Inheritance
- ValueReads
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 by[A, B](f: (A) => B)(implicit readsA: ValueReads[A]): ValueReads[B]
Define a
ValueReads[B]
in terms ofValueReads[A]
andA => B
. - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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()
- implicit def optionReads[T](implicit treads: ValueReads[T]): ValueReads[Option[T]]
Returns a
ValueReads[Option[T]]
that reads anyNULL
value asNone
and delegates non-NULL
values to the underlyingValueReads
instance. - def or[T](first: ValueReads[T], second: ValueReads[T]): ValueReads[T]
If it accepts the given PgType, uses
first
to read the value, otherwise, usesecond
. - implicit val readsBigDecimal: ValueReads[BigDecimal]
Reads BigDecimal from PgType.Numeric.
- implicit val readsBoolean: ValueReads[Boolean]
Reads Boolean from PgType.Bool.
- implicit val readsBuf: ValueReads[Buf]
Reads Buf from PgType.Bytea.
- implicit val readsByte: ValueReads[Byte]
Reads Byte from PgType.Int2.
Reads Byte from PgType.Int2.
Postgres does not have a numeric 1-byte data type. So we use 2-byte value and check bounds. NOTE: Postgres does have a 1-byte data type (i.e.: "char" with quotes), but it's very tricky to use to store numbers, so it's unlikely to be useful in practice.
- See also
https://www.postgresql.org/docs/current/datatype-numeric.html
https://dba.stackexchange.com/questions/159090/how-to-store-one-byte-integer-in-postgresql
- implicit val readsDouble: ValueReads[Double]
Reads Double from PgType.Float8 or PgType.Float4.
- implicit val readsFloat: ValueReads[Float]
Reads Float from PgType.Float4.
- val readsFloat8: ValueReads[Double]
Reads Double from PgType.Float8.
- implicit val readsInet: ValueReads[Inet]
Reads Inet from PgType.Inet.
- implicit val readsInstant: ValueReads[Instant]
Reads java.time.Instant from PgType.Timestamptz or PgType.Timestamp.
- implicit val readsInt: ValueReads[Int]
Reads Int from PgType.Int4 or readsShort.
- val readsInt4: ValueReads[Int]
Reads Int from PgType.Int4.
- val readsInt8: ValueReads[Long]
Reads Long from PgType.Int8.
- implicit val readsJson: ValueReads[Json]
Reads Json from PgType.Json or PgType.Jsonb.
- implicit val readsLocalDate: ValueReads[LocalDate]
- implicit val readsLong: ValueReads[Long]
Reads Long from PgType.Int8 or readsInt.
- implicit val readsShort: ValueReads[Short]
Reads Short from PgType.Int2.
- implicit val readsString: ValueReads[String]
Reads String from any of PgType.Text, PgType.Json, PgType.Varchar, PgType.Bpchar, PgType.Name, PgType.Unknown.
- val readsStringPermissive: ValueReads[String]
Like readsString but is more permissive with encoding errors.
- implicit val readsUuid: ValueReads[UUID]
Reads java.util.UUID from PgType.Uuid.
- def simple[T](expect: PgType*)(f: (Reader) => T): ValueReads[T]
- def simpleBuf[T](expectByteSize: Int, expect: PgType*)(f: (Buf) => T): ValueReads[T]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- implicit def traversableReads[F[_], T](implicit treads: ValueReads[T], f: Factory[T, F[T]]): ValueReads[F[T]]
Returns a ValueReads for a collection of [T] from a Postgres array type.
Returns a ValueReads for a collection of [T] from a Postgres array type.
For example, this can produce ValueReads[List[Int] for the PgType.Int4Array type.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()