Skip to main content
Version: Next

Class: Platform

core.Platform

Hierarchy#

Constructors#

constructor#

+ new Platform(): Platform

Returns: Platform

Methods#

allowsComparingTuples#

allowsComparingTuples(): boolean

Returns: boolean

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


allowsMultiInsert#

allowsMultiInsert(): boolean

Returns: boolean

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


allowsUniqueBatchUpdates#

allowsUniqueBatchUpdates(): boolean

Returns: boolean

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


cloneEmbeddable#

cloneEmbeddable<T>(data: T): T

Type parameters#

Name
T

Parameters#

NameType
dataT

Returns: T

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


convertsJsonAutomatically#

convertsJsonAutomatically(marshall?: boolean): boolean

Parameters#

NameTypeDefault value
marshallbooleanfalse

Returns: boolean

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


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:84


extractSimpleType#

extractSimpleType(type: string): string

Parameters#

NameType
typestring

Returns: string

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


getArrayDeclarationSQL#

getArrayDeclarationSQL(): string

Returns: string

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


getBigIntTypeDeclarationSQL#

getBigIntTypeDeclarationSQL(column: { autoincrement?: boolean ; length?: number ; unsigned?: boolean }): string

Parameters#

NameType
columnobject
column.autoincrement?boolean
column.length?number
column.unsigned?boolean

Returns: string

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


getBlobDeclarationSQL#

getBlobDeclarationSQL(): string

Returns: string

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


getBooleanTypeDeclarationSQL#

getBooleanTypeDeclarationSQL(): string

Returns: string

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


getCurrentTimestampSQL#

getCurrentTimestampSQL(length?: number): string

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

Parameters#

NameType
length?number

Returns: string

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


getDateTimeTypeDeclarationSQL#

getDateTimeTypeDeclarationSQL(column: { length?: number }): string

Parameters#

NameType
columnobject
column.length?number

Returns: string

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


getDateTypeDeclarationSQL#

getDateTypeDeclarationSQL(length?: number): string

Parameters#

NameType
length?number

Returns: string

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


getDecimalTypeDeclarationSQL#

getDecimalTypeDeclarationSQL(column: { precision?: number ; scale?: number }): string

Parameters#

NameType
columnobject
column.precision?number
column.scale?number

Returns: string

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


getDefaultCharset#

getDefaultCharset(): string

Returns: string

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


getDefaultIntegrityRule#

getDefaultIntegrityRule(): string

Returns: string

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


getDefaultVersionLength#

getDefaultVersionLength(): number

Returns: number

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


getDoubleDeclarationSQL#

getDoubleDeclarationSQL(): string

Returns: string

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


getEnumTypeDeclarationSQL#

getEnumTypeDeclarationSQL(column: { autoincrement?: boolean ; fieldNames: string[] ; items?: unknown[] ; length?: number ; unsigned?: boolean }): string

Parameters#

NameType
columnobject
column.autoincrement?boolean
column.fieldNamesstring[]
column.items?unknown[]
column.length?number
column.unsigned?boolean

Returns: string

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


getExceptionConverter#

getExceptionConverter(): ExceptionConverter

Returns: ExceptionConverter

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


getFloatDeclarationSQL#

getFloatDeclarationSQL(): string

Returns: string

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


getIndexName#

getIndexName(tableName: string, columns: string[], type: "index" | "unique" | "primary" | "foreign" | "sequence"): string

Returns the default name of index for the given columns

Parameters#

NameType
tableNamestring
columnsstring[]
type"index" | "unique" | "primary" | "foreign" | "sequence"

Returns: string

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


getIntegerTypeDeclarationSQL#

getIntegerTypeDeclarationSQL(column: { autoincrement?: boolean ; length?: number ; unsigned?: boolean }): string

Parameters#

NameType
columnobject
column.autoincrement?boolean
column.length?number
column.unsigned?boolean

Returns: string

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


getJsonDeclarationSQL#

getJsonDeclarationSQL(): string

Returns: string

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


getMappedType#

getMappedType(type: string): Type<unknown, unknown>

Parameters#

NameType
typestring

Returns: Type<unknown, unknown>

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


getNamingStrategy#

getNamingStrategy(): function

Returns: () => NamingStrategy

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


getRegExpOperator#

getRegExpOperator(): string

Returns: string

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


getRepositoryClass#

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

Type parameters#

Name
T

Returns: Constructor<EntityRepository<T>>

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


getSchemaGenerator#

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

Parameters#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns: ISchemaGenerator

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


getSchemaHelper#

getSchemaHelper(): unknown

Returns: unknown

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


getSearchJsonPropertyKey#

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

Parameters#

NameType
pathstring[]
typestring

Returns: string

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


getSearchJsonPropertySQL#

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

Parameters#

NameType
pathstring
typestring

Returns: string

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


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:91


getSmallIntTypeDeclarationSQL#

getSmallIntTypeDeclarationSQL(column: { autoincrement?: boolean ; length?: number ; unsigned?: boolean }): string

Parameters#

NameType
columnobject
column.autoincrement?boolean
column.length?number
column.unsigned?boolean

Returns: string

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


getTextTypeDeclarationSQL#

getTextTypeDeclarationSQL(_column: { length?: number }): string

Parameters#

NameType
_columnobject
_column.length?number

Returns: string

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


getTimeTypeDeclarationSQL#

getTimeTypeDeclarationSQL(length?: number): string

Parameters#

NameType
length?number

Returns: string

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


getTinyIntTypeDeclarationSQL#

getTinyIntTypeDeclarationSQL(column: { autoincrement?: boolean ; length?: number ; unsigned?: boolean }): string

Parameters#

NameType
columnobject
column.autoincrement?boolean
column.length?number
column.unsigned?boolean

Returns: string

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


getUuidTypeDeclarationSQL#

getUuidTypeDeclarationSQL(column: { length?: number }): string

Parameters#

NameType
columnobject
column.length?number

Returns: string

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


getVarcharTypeDeclarationSQL#

getVarcharTypeDeclarationSQL(column: { length?: number }): string

Parameters#

NameType
columnobject
column.length?number

Returns: string

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


indexForeignKeys#

indexForeignKeys(): boolean

Returns: boolean

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


isBigIntProperty#

isBigIntProperty(prop: EntityProperty<any>): boolean

Parameters#

NameType
propEntityProperty<any>

Returns: boolean

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


isNumericColumn#

isNumericColumn(mappedType: Type<unknown, unknown>): boolean

Parameters#

NameType
mappedTypeType<unknown, unknown>

Returns: boolean

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


isRaw#

isRaw(value: any): boolean

Parameters#

NameType
valueany

Returns: boolean

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


marshallArray#

marshallArray(values: string[]): string

Parameters#

NameType
valuesstring[]

Returns: string

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


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:77


processDateProperty#

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

Parameters#

NameType
valueunknown

Returns: string | number | Date

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


quoteIdentifier#

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

Parameters#

NameTypeDefault value
idstring-
quotestring'`'

Returns: string

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


quoteValue#

quoteValue(value: any): string

Parameters#

NameType
valueany

Returns: string

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


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:122


requiresValuesKeyword#

requiresValuesKeyword(): boolean

Returns: boolean

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


setConfig#

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

Parameters#

NameType
configConfiguration<IDatabaseDriver<Connection>>

Returns: void

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


supportsTransactions#

supportsTransactions(): boolean

Returns: boolean

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


supportsUnsigned#

supportsUnsigned(): boolean

Returns: boolean

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


unmarshallArray#

unmarshallArray(value: string): string[]

Parameters#

NameType
valuestring

Returns: string[]

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


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:59


usesBatchUpdates#

usesBatchUpdates(): boolean

Whether or not the driver supports updating many records at once

Returns: boolean

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


usesCascadeStatement#

usesCascadeStatement(): boolean

Returns: boolean

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


usesDefaultKeyword#

usesDefaultKeyword(): boolean

Returns: boolean

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


usesDifferentSerializedPrimaryKey#

usesDifferentSerializedPrimaryKey(): boolean

Returns: boolean

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


usesImplicitTransactions#

usesImplicitTransactions(): boolean

Returns: boolean

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


usesPivotTable#

usesPivotTable(): boolean

Returns: boolean

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


usesReturningStatement#

usesReturningStatement(): boolean

Returns: boolean

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