Registration

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.

The terms travel with the class rather than staying with that client, because the converters that apply them belong to the database: a value of this class is written on strategy and its payload goes through json whichever client the query runs through.

Constructors

Link copied to clipboard
constructor(name: String, kClass: KClass<T>, serializer: KSerializer<T>, json: EnumAwareJson, strategy: DynamicWriteStrategy)

Properties

Link copied to clipboard

The registering client's Json, with the registered enums folded in as it is resolved.

Link copied to clipboard
Link copied to clipboard

The discriminator, as the database stores it.

Link copied to clipboard

The registering client's write strategy.

Functions

Link copied to clipboard
fun decode(payload: String, json: Json): Any
Link copied to clipboard
fun encode(value: Any, json: Json): String

The payload as the text a jsonb attribute is encoded from.