Package-level declarations

Types

Link copied to clipboard
internal class CatalogHolder

The one mutable thing in the type system: which TypeCatalog is the current one for a database.

Link copied to clipboard
internal object CatalogLoader

Utility object responsible for loading PostgreSQL type definitions from the database and populating a CatalogHolder.

Link copied to clipboard

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

Link copied to clipboard
internal class CodecScope(val types: TypeDictionary)

The dictionaries a container or domain codec resolves through as it walks a value.

Link copied to clipboard

A factory for creating PostgreSQL container types such as composites, ranges, and multiranges.

Link copied to clipboard
internal data class DatabaseKey(val servers: Set<ServerAddress>, val database: String)

Identifies the database a CatalogHolder belongs to: the servers it is reached on, and its name.

Link copied to clipboard

Where the type catalogs live: one per database - the servers it is reached on and its name - for the whole JVM.

Link copied to clipboard
internal class IntObjectMap<V>

A highly optimized, primitive-key map implementation that maps primitive Int keys to object values.

Link copied to clipboard
data class PgEnumRegistration(val qualifiedName: QualifiedName, val pgConvention: CaseConvention, val kotlinConvention: CaseConvention)

What an enum was registered as: the type it stands for, and the two conventions that map one side's names onto the other's.

Link copied to clipboard
class TypeCatalog(val dictionary: TypeDictionary, val codecs: CodecDictionary, val resultConverters: Map<KClass<*>, List<ResultConverter<*, *>>>, val anyResultConverters: List<ResultConverter<*, *>>, val parameterConverters: List<ParameterConverter<*>>, val registeredComposites: Map<KClass<*>, QualifiedName>, val compositeClassByName: Map<QualifiedName, KClass<*>>, val registeredEnums: Map<KClass<*>, PgEnumRegistration>, val enumClassByName: Map<QualifiedName, KClass<*>>, val attachments: Map<KClass<*>, Any>)

Everything the driver knows about a database's types, as one immutable value.

Link copied to clipboard

A dictionary that holds PostgreSQL types definitions and allows querying them by OID or name.

Link copied to clipboard
class TypeLookup(catalogSource: () -> TypeCatalog, searchPathProvider: () -> List<String>)

The type system as something to read: dictionaries, containers and OID resolution, and nothing that writes.

Link copied to clipboard
class TypeManager(holder: CatalogHolder, searchPathProvider: () -> List<String> = { emptyList() })

Registers PostgreSQL types, codecs and converters, and reads back what is registered.

Functions

Link copied to clipboard
internal fun builtinCatalog(): TypeCatalog

The catalog the driver starts out with, before a database has said anything: the codecs it ships, the types those codecs name, and the converters that map them.