Skip to content

Protocol

PostgresDynamicTypeEncodable

A type that can encode itself to a Postgres wire binary representation. Dynamic types are types that don’t have a well-known Postgres type OID at compile time. For example, custom types created at runtime, such as enums, or extension types whose OID is not stable between databases.
protocol PostgresDynamicTypeEncodable : PostgresThrowingDynamicTypeEncodable

Overview

This is the non-throwing alternative to PostgresThrowingDynamicTypeEncodable. It allows users to create PostgresQuerys via ExpressibleByStringInterpolation without having to spell try.

Topics

Instance Methods

  • encode(into:context:)
    Encode the entity into byteBuffer in the format specified by psqlFormat, using the provided context as needed, without setting the byte count.

Relationships

Inherits From

Inherited By

Conforming Types

See Also

Encoding

  • PostgresEncodable
    A type that can encode itself to a Postgres wire binary representation.
  • PostgresNonThrowingEncodable
    A type that can encode itself to a Postgres wire binary representation. It enforces that the encode(into:context:) does not throw. This allows users to create PostgresQuerys via ExpressibleByStringInterpolation without having to spell try.
  • PostgresThrowingDynamicTypeEncodable
    A type that can encode itself to a Postgres wire binary representation. Dynamic types are types that don’t have a well-known Postgres type OID at compile time. For example, custom types created at runtime, such as enums, or extension types whose OID is not stable between databases.
  • PostgresArrayEncodable
    A type of which arrays can be encoded into and decoded from a Postgres binary format.
  • PostgresRangeEncodable
    A type that can be encoded into a Postgres range type where it is the bound type.
  • PostgresRangeArrayEncodable
    A type that can be encoded into a Postgres range array type where it is the bound type.
  • PostgresEncodingContext
    A context that is passed to Swift objects that are encoded into the Postgres wire format. Used to pass further information to the encoding method.