Skip to content
# Class: TypeTransformationPostProcessor

Defined in: packages/core/src/transformers/TypeTransformationPostProcessor.ts:41

Applies type transformations to JSON results from PostgreSQL

Constructors

Constructor

new TypeTransformationPostProcessor(config): TypeTransformationPostProcessor

Defined in: packages/core/src/transformers/TypeTransformationPostProcessor.ts:42

Parameters

config

TypeTransformationConfig = {}

Returns

TypeTransformationPostProcessor

Methods

transformResult()

transformResult<T&gt;(result): T

Defined in: packages/core/src/transformers/TypeTransformationPostProcessor.ts:55

Transform a single result object

Type Parameters

T

T = unknown

Parameters

result

unknown

The result object from PostgreSQL JSON query

Returns

T

Transformed result with proper TypeScript types


createDefaultConfig()

static createDefaultConfig(): TypeTransformationConfig

Defined in: packages/core/src/transformers/TypeTransformationPostProcessor.ts:291

Create a default configuration for common PostgreSQL types Enables value-based detection with loose date detection by default

Returns

TypeTransformationConfig


createSafeConfig()

static createSafeConfig(columnMappings?): TypeTransformationConfig

Defined in: packages/core/src/transformers/TypeTransformationPostProcessor.ts:332

Create a safe configuration for handling user input Disables value-based detection and uses strict date detection

Parameters

columnMappings?

Returns

TypeTransformationConfig

Released under the MIT License.