PgCodec

zio.blocks.sql.PgCodec
object PgCodec

PostgreSQL-specific DbParam instances for collection types.

Import PgCodec.given to enable passing Seq[A], List[A], and IndexedSeq[A] as SQL array parameters in the sql"..." interpolator.

import zio.blocks.sql.*
import zio.blocks.sql.PgCodec.given

val ids: List[String] = List("a", "b", "c")
val frag = sql"SELECT * FROM products WHERE id = ANY($ids)"

These instances produce DbValue.DbArray values that bind as JDBC arrays via Connection.createArrayOf. The SQL element type is inferred from the Scala element type.

Attributes

Source
PgCodec.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
PgCodec.type

Members list

Type members

Classlikes

object iArrayStringParam extends DbParam[IArray[String]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[IArray[String]]
class Object
trait Matchable
class Any
Self type
object indexedSeqIntParam extends DbParam[IndexedSeq[Int]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[IndexedSeq[Int]]
class Object
trait Matchable
class Any
Self type
object indexedSeqLongParam extends DbParam[IndexedSeq[Long]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[IndexedSeq[Long]]
class Object
trait Matchable
class Any
Self type
object indexedSeqStringParam extends DbParam[IndexedSeq[String]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[IndexedSeq[String]]
class Object
trait Matchable
class Any
Self type
object listBooleanParam extends DbParam[List[Boolean]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[List[Boolean]]
class Object
trait Matchable
class Any
Self type
object listDoubleParam extends DbParam[List[Double]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[List[Double]]
class Object
trait Matchable
class Any
Self type
object listIntParam extends DbParam[List[Int]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[List[Int]]
class Object
trait Matchable
class Any
Self type
object listLongParam extends DbParam[List[Long]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[List[Long]]
class Object
trait Matchable
class Any
Self type
object listStringParam extends DbParam[List[String]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[List[String]]
class Object
trait Matchable
class Any
Self type
object listUuidParam extends DbParam[List[UUID]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[List[UUID]]
class Object
trait Matchable
class Any
Self type
object seqBooleanParam extends DbParam[Seq[Boolean]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[Seq[Boolean]]
class Object
trait Matchable
class Any
Self type
object seqDoubleParam extends DbParam[Seq[Double]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[Seq[Double]]
class Object
trait Matchable
class Any
Self type
object seqIntParam extends DbParam[Seq[Int]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[Seq[Int]]
class Object
trait Matchable
class Any
Self type
object seqLongParam extends DbParam[Seq[Long]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[Seq[Long]]
class Object
trait Matchable
class Any
Self type
object seqStringParam extends DbParam[Seq[String]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[Seq[String]]
class Object
trait Matchable
class Any
Self type
object seqUuidParam extends DbParam[Seq[UUID]]

Attributes

Source
PgCodec.scala
Supertypes
trait DbParam[Seq[UUID]]
class Object
trait Matchable
class Any
Self type

Givens

Givens

given iArrayStringCodec: DbCodec[IArray[String]]

Attributes

Source
PgCodec.scala

DbCodec for the blocks-native JSON AST type (zio.blocks.schema.json.Json), stored as PostgreSQL jsonb. Uses Json.print/Json.parseUnsafe directly as the JSON string codec, since they already are the canonical serialization for this type (no JsonCodec round-trip needed).

DbCodec for the blocks-native JSON AST type (zio.blocks.schema.json.Json), stored as PostgreSQL jsonb. Uses Json.print/Json.parseUnsafe directly as the JSON string codec, since they already are the canonical serialization for this type (no JsonCodec round-trip needed).

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala
given listStringCodec: DbCodec[List[String]]

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala

Attributes

Source
PgCodec.scala