#
Class: Type<JSType, DBType>core.Type
#
Type parametersName | Default |
---|---|
JSType | string |
DBType | JSType |
#
Hierarchy#
Constructors#
constructor+ new Type<JSType, DBType>(): Type<JSType, DBType>
#
Type parameters:Name | Default |
---|---|
JSType | string |
DBType | JSType |
Returns: Type<JSType, DBType>
#
Properties#
typesâ–ª Private
Readonly
Static
types: Map<any, any>
Defined in: packages/core/src/types/Type.ts:6
#
Methods#
compareAsTypeâ–¸ compareAsType(): string
How should the raw database values be compared? Used in EntityComparator
.
Possible values: string | number | boolean | date | any | buffer | array
Returns: string
Defined in: packages/core/src/types/Type.ts:26
#
convertToDatabaseValueâ–¸ convertToDatabaseValue(value
: JSType | DBType, platform
: Platform, fromQuery?
: boolean): DBType
Converts a value from its JS representation to its database representation of this type.
#
Parameters:Name | Type |
---|---|
value | JSType | DBType |
platform | Platform |
fromQuery? | boolean |
Returns: DBType
Defined in: packages/core/src/types/Type.ts:11
#
convertToJSValueâ–¸ convertToJSValue(value
: JSType | DBType, platform
: Platform): JSType
Converts a value from its database representation to its JS representation of this type.
#
Parameters:Name | Type |
---|---|
value | JSType | DBType |
platform | Platform |
Returns: JSType
Defined in: packages/core/src/types/Type.ts:18
#
getColumnTypeâ–¸ getColumnType(prop
: EntityProperty<any>, platform
: Platform): string
Gets the SQL declaration snippet for a field of this type.
#
Parameters:Name | Type |
---|---|
prop | EntityProperty<any> |
platform | Platform |
Returns: string
Defined in: packages/core/src/types/Type.ts:41
#
toJSONâ–¸ toJSON(value
: JSType, platform
: Platform): JSType | DBType
Converts a value from its JS representation to its serialized JSON form of this type. By default uses the runtime value.
#
Parameters:Name | Type |
---|---|
value | JSType |
platform | Platform |
Returns: JSType | DBType
Defined in: packages/core/src/types/Type.ts:34
#
getTypeâ–¸ Static
getType<JSType, DBType>(cls
: Constructor<Type<JSType, DBType>>): Type<JSType, DBType>
#
Type parameters:Name |
---|
JSType |
DBType |
#
Parameters:Name | Type |
---|---|
cls | Constructor<Type<JSType, DBType>> |
Returns: Type<JSType, DBType>
Defined in: packages/core/src/types/Type.ts:46