Skip to main content
Version: Next

Class: Platform

core.Platform

Hierarchy#

Constructors#

constructor#

new 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

Type parameters#

Name
T

Parameters#

NameType
dataT

Returns#

T

Defined in#

packages/core/src/platforms/Platform.ts:318


convertsJsonAutomatically#

convertsJsonAutomatically(marshall?): boolean

Parameters#

NameTypeDefault value
marshallbooleanfalse

Returns#

boolean

Defined in#

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


denormalizePrimaryKey#

denormalizePrimaryKey(data): 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

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): 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?): 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): string

Parameters#

NameType
columnObject
column.length?number

Returns#

string

Defined in#

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


getDateTypeDeclarationSQL#

getDateTypeDeclarationSQL(length?): string

Parameters#

NameType
length?number

Returns#

string

Defined in#

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


getDecimalTypeDeclarationSQL#

getDecimalTypeDeclarationSQL(column): 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


getEntityGenerator#

getEntityGenerator(em): IEntityGenerator

Parameters#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns#

IEntityGenerator

Defined in#

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


getEnumTypeDeclarationSQL#

getEnumTypeDeclarationSQL(column): 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, columns, type): 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:344


getIntegerTypeDeclarationSQL#

getIntegerTypeDeclarationSQL(column): 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): Type<unknown, unknown>

Parameters#

NameType
typestring

Returns#

Type<unknown, unknown>

Defined in#

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


getMigrator#

getMigrator(em): IMigrator

Parameters#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns#

IMigrator

Defined in#

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


getNamingStrategy#

getNamingStrategy(): () => NamingStrategy

Returns#

fn

new getNamingStrategy()

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): 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, type): string

Parameters#

NameType
pathstring[]
typestring

Returns#

string

Defined in#

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


getSearchJsonPropertySQL#

getSearchJsonPropertySQL(path, type): string

Parameters#

NameType
pathstring
typestring

Returns#

string

Defined in#

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


getSerializedPrimaryKeyField#

getSerializedPrimaryKeyField(field): 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): 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): string

Parameters#

NameType
_columnObject
_column.length?number

Returns#

string

Defined in#

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


getTimeTypeDeclarationSQL#

getTimeTypeDeclarationSQL(length?): string

Parameters#

NameType
length?number

Returns#

string

Defined in#

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


getTinyIntTypeDeclarationSQL#

getTinyIntTypeDeclarationSQL(column): 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): string

Parameters#

NameType
columnObject
column.length?number

Returns#

string

Defined in#

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


getVarcharTypeDeclarationSQL#

getVarcharTypeDeclarationSQL(column): 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): boolean

Parameters#

NameType
propEntityProperty<any>

Returns#

boolean

Defined in#

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


isNumericColumn#

isNumericColumn(mappedType): boolean

Parameters#

NameType
mappedTypeType<unknown, unknown>

Returns#

boolean

Defined in#

packages/core/src/platforms/Platform.ts:333


isRaw#

isRaw(value): boolean

Parameters#

NameType
valueany

Returns#

boolean

Defined in#

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


marshallArray#

marshallArray(values): string

Parameters#

NameType
valuesstring[]

Returns#

string

Defined in#

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


normalizePrimaryKey#

normalizePrimaryKey<T>(data): T

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

Type parameters#

NameType
TT: string | number = string | number

Parameters#

NameType
dataIPrimaryKeyValue | Primary<T>

Returns#

T

Defined in#

packages/core/src/platforms/Platform.ts:77


processDateProperty#

processDateProperty(value): string | number | Date

Parameters#

NameType
valueunknown

Returns#

string | number | Date

Defined in#

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


quoteIdentifier#

quoteIdentifier(id, quote?): string

Parameters#

NameTypeDefault value
idstringundefined
quotestring'`'

Returns#

string

Defined in#

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


quoteValue#

quoteValue(value): string

Parameters#

NameType
valueany

Returns#

string

Defined in#

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


quoteVersionValue#

quoteVersionValue(value, prop): 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): void

Parameters#

NameType
configConfiguration<IDatabaseDriver<Connection>>

Returns#

void

Defined in#

packages/core/src/platforms/Platform.ts:322


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


unmarshallArray#

unmarshallArray(value): 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