Skip to main content
Version: 4.5

Class: Platform#

core.Platform

Hierarchy#

Constructors#

constructor#

+ new Platform(): Platform

Returns: Platform

Properties#

config#

Protected config: Configuration<IDatabaseDriver<Connection>>

Defined in: packages/core/src/platforms/Platform.ts:11


exceptionConverter#

Protected Readonly exceptionConverter: ExceptionConverter

Defined in: packages/core/src/platforms/Platform.ts:10


timezone#

Protected Optional timezone: string

Defined in: packages/core/src/platforms/Platform.ts:12

Methods#

allowsComparingTuples#

allowsComparingTuples(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:120


allowsMultiInsert#

allowsMultiInsert(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:46


allowsUniqueBatchUpdates#

allowsUniqueBatchUpdates(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:124


cloneEmbeddable#

cloneEmbeddable<T>(data: T): T

Type parameters:#

Name
T

Parameters:#

NameType
dataT

Returns: T

Defined in: packages/core/src/platforms/Platform.ts:204


convertsJsonAutomatically#

convertsJsonAutomatically(marshall?: boolean): boolean

Parameters:#

NameTypeDefault value
marshallbooleanfalse

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:172


denormalizePrimaryKey#

denormalizePrimaryKey(data: IPrimaryKeyValue): IPrimaryKeyValue

Converts scalar primary key representation to native driver wrapper (e.g. string to mongodb's ObjectId)

Parameters:#

NameType
dataIPrimaryKeyValue

Returns: IPrimaryKeyValue

Defined in: packages/core/src/platforms/Platform.ts:78


getArrayDeclarationSQL#

getArrayDeclarationSQL(): string

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:140


getBigIntTypeDeclarationSQL#

getBigIntTypeDeclarationSQL(): string

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:136


getBlobDeclarationSQL#

getBlobDeclarationSQL(): string

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:156


getCurrentTimestampSQL#

getCurrentTimestampSQL(length: number): string

Returns the SQL specific for the platform to get the current timestamp

Parameters:#

NameType
lengthnumber

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:96


getDateTypeDeclarationSQL#

getDateTypeDeclarationSQL(length: number): string

Parameters:#

NameType
lengthnumber

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:100


getDefaultCharset#

getDefaultCharset(): string

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:180


getExceptionConverter#

getExceptionConverter(): ExceptionConverter

Returns: ExceptionConverter

Defined in: packages/core/src/platforms/Platform.ts:184


getJsonDeclarationSQL#

getJsonDeclarationSQL(): string

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:160


getNamingStrategy#

getNamingStrategy(): function

Returns: () => NamingStrategy

Defined in: packages/core/src/platforms/Platform.ts:26


getRegExpOperator#

getRegExpOperator(): string

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:108


getRepositoryClass#

getRepositoryClass<T>(): Constructor<EntityRepository<T>>

Type parameters:#

Name
T

Returns: Constructor<EntityRepository<T>>

Defined in: packages/core/src/platforms/Platform.ts:176


getSchemaGenerator#

getSchemaGenerator(em: EntityManager<IDatabaseDriver<Connection>>): ISchemaGenerator

Parameters:#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns: ISchemaGenerator

Defined in: packages/core/src/platforms/Platform.ts:188


getSchemaHelper#

getSchemaHelper(): undefined | { getTypeDefinition: (prop: EntityProperty<any>, types?: Dictionary<string[]>, lengths?: Dictionary<number>, allowZero?: boolean) => string }

Returns: undefined | { getTypeDefinition: (prop: EntityProperty<any>, types?: Dictionary<string[]>, lengths?: Dictionary<number>, allowZero?: boolean) => string }

Defined in: packages/core/src/platforms/Platform.ts:38


getSearchJsonPropertyKey#

getSearchJsonPropertyKey(path: string[], type: string): string

Parameters:#

NameType
pathstring[]
typestring

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:168


getSearchJsonPropertySQL#

getSearchJsonPropertySQL(path: string, type: string): string

Parameters:#

NameType
pathstring
typestring

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:164


getSerializedPrimaryKeyField#

getSerializedPrimaryKeyField(field: string): string

Used when serializing via toObject and toJSON methods, allows to use different PK field name (like id instead of _id)

Parameters:#

NameType
fieldstring

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:85


getTimeTypeDeclarationSQL#

getTimeTypeDeclarationSQL(length: number): string

Parameters:#

NameType
lengthnumber

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:104


isBigIntProperty#

isBigIntProperty(prop: EntityProperty<any>): boolean

Parameters:#

NameType
propEntityProperty<any>

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:128


isRaw#

isRaw(value: any): boolean

Parameters:#

NameType
valueany

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:132


marshallArray#

marshallArray(values: string[]): string

Parameters:#

NameType
valuesstring[]

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:144


normalizePrimaryKey#

normalizePrimaryKey<T>(data: IPrimaryKeyValue | Primary<T>): T

Normalizes primary key wrapper to scalar value (e.g. mongodb's ObjectId to string)

Type parameters:#

NameTypeDefault
Tstring | numberstring | number

Parameters:#

NameType
dataIPrimaryKeyValue | Primary<T>

Returns: T

Defined in: packages/core/src/platforms/Platform.ts:71


processDateProperty#

processDateProperty(value: unknown): string | number | Date

Parameters:#

NameType
valueunknown

Returns: string | number | Date

Defined in: packages/core/src/platforms/Platform.ts:192


quoteIdentifier#

quoteIdentifier(id: string, quote?: string): string

Parameters:#

NameTypeDefault value
idstring-
quotestring'`'

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:196


quoteValue#

quoteValue(value: any): string

Parameters:#

NameType
valueany

Returns: string

Defined in: packages/core/src/platforms/Platform.ts:200


quoteVersionValue#

quoteVersionValue(value: number | Date, prop: EntityProperty<any>): string | number | Date

Parameters:#

NameType
valuenumber | Date
propEntityProperty<any>

Returns: string | number | Date

Defined in: packages/core/src/platforms/Platform.ts:112


requiresNullableForAlteringColumn#

requiresNullableForAlteringColumn(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:42


requiresValuesKeyword#

requiresValuesKeyword(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:116


setConfig#

setConfig(config: Configuration<IDatabaseDriver<Connection>>): void

Parameters:#

NameType
configConfiguration<IDatabaseDriver<Connection>>

Returns: void

Defined in: packages/core/src/platforms/Platform.ts:208


supportsTransactions#

supportsTransactions(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:18


unmarshallArray#

unmarshallArray(value: string): string[]

Parameters:#

NameType
valuestring

Returns: string[]

Defined in: packages/core/src/platforms/Platform.ts:148


usesBatchInserts#

usesBatchInserts(): boolean

Whether or not the driver supports retuning list of created PKs back when multi-inserting

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:53


usesBatchUpdates#

usesBatchUpdates(): boolean

Whether or not the driver supports updating many records at once

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:60


usesCascadeStatement#

usesCascadeStatement(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:34


usesDefaultKeyword#

usesDefaultKeyword(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:64


usesDifferentSerializedPrimaryKey#

usesDifferentSerializedPrimaryKey(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:89


usesImplicitTransactions#

usesImplicitTransactions(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:22


usesPivotTable#

usesPivotTable(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:14


usesReturningStatement#

usesReturningStatement(): boolean

Returns: boolean

Defined in: packages/core/src/platforms/Platform.ts:30

Last updated on by Renovate Bot