CodecDictionary

A dictionary that maps PostgreSQL OIDs and Kotlin classes to their corresponding TypeCodecs.

Provides methods for looking up codecs for parameters and results mapping, as well as registering custom codecs. Instances are immutable.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
internal fun buildUpdated(dictionary: TypeDictionary): CodecDictionary

Rebuilds the dictionary against a catalog's types, keeping the codecs registered by hand and creating one for every type they leave uncovered.

Link copied to clipboard
fun <T : Any> getCodecByClass(kClass: KClass<T>): TypeCodec<T>?

Retrieves a default TypeCodec for the given Kotlin class.

Link copied to clipboard
fun <T : Any> getCodecByOid(oid: Int): TypeCodec<T>?

Retrieves a TypeCodec suitable for the given PostgreSQL OID.

Link copied to clipboard
fun getOidForCodec(codec: TypeCodec<*>): Int?
Link copied to clipboard
internal fun withRegisteredCodec(codec: TypeCodec<*>, dictionary: TypeDictionary): CodecDictionary

Creates a new CodecDictionary by registering an additional TypeCodec.