enumSerializers
The contextual serializers writing each registered enum under the label PostgreSQL holds, rather than under the Kotlin constant's own name.
registerEnum teaches the driver that Praetor is PRAETOR in an enum column. A jsonb payload never reaches that, so the same value would read two ways depending on where it was stored. Every conversion this class runs folds these in as it goes - over json, and over any Json handed to resultConverter, parameterConverter or toDynamicDto - so nothing there needs them added. This is exposed for the Json built elsewhere: an HTTP layer, or a jsonb column written through the driver rather than through a dynamic_dto.
val api = Json {
serializersModule = octaviusSerializersModule + db.dynamicTypes.enumSerializers
}@Contextual on the property is what selects one; the enum itself needs no @Serializable and no serializer written by hand, whether it was named at registerEnum or found by a scan through PgEnumType.
It answers for the enums registered at the moment it is read - registration being global to the database and done at startup - so a Json built from it before startup has finished is a Json short of whatever registered after. That is the difference between taking the module and letting this class convert: a conversion folds the module in as it runs and so never goes stale, a module you folded into a Json of your own is the set as it stood.
Reading it opens a session if this client has not reached the driver's catalog yet, which is why it is something to take once and keep rather than to reach for per request.