Version: 4.3

Class: JsonType

Hierarchy

  • Type<unknown, string | null>

    JsonType

Methods

compareAsType

compareAsType(): string

Inherited from Type.compareAsType

Defined in packages/core/src/types/Type.ts:26

How should the raw database values be compared? Used in EntityComparator. Possible values: string | number | boolean | date | any | buffer | array

Returns: string


convertToDatabaseValue

convertToDatabaseValue(value: unknown, platform: Platform): string | null

Overrides Type.convertToDatabaseValue

Defined in packages/core/src/types/JsonType.ts:8

Parameters:

NameType
valueunknown
platformPlatform

Returns: string | null


convertToJSValue

convertToJSValue(value: string | unknown, platform: Platform): unknown

Overrides Type.convertToJSValue

Defined in packages/core/src/types/JsonType.ts:16

Parameters:

NameType
valuestring | unknown
platformPlatform

Returns: unknown


getColumnType

getColumnType(prop: EntityProperty, platform: Platform): string

Overrides Type.getColumnType

Defined in packages/core/src/types/JsonType.ts:24

Parameters:

NameType
propEntityProperty
platformPlatform

Returns: string


toJSON

toJSON(value: unknown, platform: Platform): unknown | string | null

Inherited from Type.toJSON

Defined in packages/core/src/types/Type.ts:34

Converts a value from its JS representation to its serialized JSON form of this type. By default uses the runtime value.

Parameters:

NameType
valueunknown
platformPlatform

Returns: unknown | string | null


getType

StaticgetType<JSType, DBType>(cls: Constructor<Type<JSType, DBType>>): Type<JSType, DBType>

Inherited from Type.getType

Defined in packages/core/src/types/Type.ts:46

Type parameters:

Name
JSType
DBType

Parameters:

NameType
clsConstructor<Type<JSType, DBType>>

Returns: Type<JSType, DBType>

Last updated on by Martin Adámek