PgEnumSerializer

internal class PgEnumSerializer(enumClass: KClass<*>, registration: PgEnumRegistration) : KSerializer<Any>

Writes a registered enum into JSON under its PostgreSQL label, as the driver writes it in an enum column, and reads it back. Built from the registration, so an enum named at registerEnum and one found by @PgEnumType are covered alike.

Parameters

registration

Where the two naming conventions come from.

Constructors

Link copied to clipboard
constructor(enumClass: KClass<*>, registration: PgEnumRegistration)

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): Any
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: Any)