Package-level declarations
Types
The dynamic_dto composite in Kotlin: a discriminator and a JSON payload.
The dynamic_dto names a database knows and the class each stands for, attached to the driver's type catalog, since a discriminator stored in the data has to mean the same class to every client on the database. It is replaced and dropped with the catalog, and pinned for an execution with the converters reading it.
The dynamic_dto types this client knows: where they are registered, and where a value is wrapped for writing.
When an instance of a class registered as a dynamic type is written as a dynamic_dto without being wrapped.
The registered enums' serializers, as a module and as a Json with it folded in, resolved per conversion and rebuilt only when the registrations change. The driver replaces TypeCatalog.registeredEnums whole on every registration, so its identity is the version and checking it is a reference comparison.
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.
Properties
The statements that create the dynamic_dto type and its constructors, harmless to run twice. Put them in a migration, or run them with DynamicTypes.install.
Functions
The discriminator kClass declares, for the overloads that take no name.