ConverterRegistry

A registry managing the converters used for mapping between Kotlin objects and PostgreSQL types.

It holds both ResultConverterRegistry for handling incoming data from the database, and ParameterConverterRegistry for handling outbound query parameters. Furthermore, it keeps track of registered composite type mappings.

Constructors

Link copied to clipboard
internal constructor()

Properties

Link copied to clipboard

A thread-safe map mapping database composite names to their corresponding Kotlin classes.

Link copied to clipboard

The registry responsible for parameter conversion (Kotlin -> PostgreSQL).

Link copied to clipboard

A thread-safe map holding registration details for custom Kotlin composite data classes.

Link copied to clipboard

A thread-safe map holding what every registered Kotlin enum was registered as.

Link copied to clipboard

The registry responsible for result conversion (PostgreSQL -> Kotlin).

Functions

Link copied to clipboard
internal fun registerAutoCompositeType(kClass: KClass<*>, name: String, schema: String = "")

Registers a Kotlin data class to be automatically mapped to and from a PostgreSQL composite type.

Link copied to clipboard
internal fun registerEnumType(kClass: KClass<*>, qualifiedName: QualifiedName, pgConvention: CaseConvention, kotlinConvention: CaseConvention)

Records that kClass is the PostgreSQL enum qualifiedName, under the conventions the converters were built with.

Link copied to clipboard

Registers a custom ParameterConverter.

Link copied to clipboard
internal fun registerResultConverter(converter: ResultConverter<*, *>)

Registers a custom ResultConverter.