Package-level declarations

Types

Link copied to clipboard
data class DynamicDto(val typeName: String, val dataPayload: String)

The Kotlin side of the dynamic_dto composite: a discriminator and a JSON payload.

Link copied to clipboard
internal class DynamicRegistry

The dynamic_dto names a database knows, and the class each one stands for.

Link copied to clipboard
class DynamicTypes(client: OctaviusClient, val json: Json = octaviusJson, val strategy: DynamicWriteStrategy = DynamicWriteStrategy.AUTOMATIC_WHEN_UNAMBIGUOUS)

The dynamic_dto types this client knows, and what you do with them: register, and - where strategy or the class leaves the question open - wrap.

Link copied to clipboard

When an object registered as a dynamic type is written as one without being asked to be.

Link copied to clipboard
internal class EnumAwareJson(base: Json)

The registered enums' serializers, as a module and as a Json with that module folded in, both rebuilt only when the set of registrations changes.

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

Writes a registered enum into JSON under the label PostgreSQL holds, and reads it back.

Link copied to clipboard
internal class Registration<T : Any>(val name: String, val kClass: KClass<T>, serializer: KSerializer<T>, val json: EnumAwareJson, val strategy: DynamicWriteStrategy)

One class registered as a dynamic_dto, on the terms of the client that registered it.

Properties

Link copied to clipboard

The statements that create the dynamic_dto type and its constructors, written so that running them twice is harmless.

Functions

Link copied to clipboard
internal fun declaredTypeNameOf(kClass: KClass<*>): String

The discriminator kClass declares, for the overloads that take no name.