Skip to main content
Version: Next

Class: AbstractSqlPlatform

knex.AbstractSqlPlatform

Hierarchy#

Constructors#

constructor#

new AbstractSqlPlatform()

Inherited from#

Platform.constructor

Methods#

allowsComparingTuples#

allowsComparingTuples(): boolean

Returns#

boolean

Inherited from#

Platform.allowsComparingTuples

Defined in#

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


allowsMultiInsert#

allowsMultiInsert(): boolean

Returns#

boolean

Inherited from#

Platform.allowsMultiInsert

Defined in#

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


allowsUniqueBatchUpdates#

allowsUniqueBatchUpdates(): boolean

Returns#

boolean

Inherited from#

Platform.allowsUniqueBatchUpdates

Defined in#

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


cloneEmbeddable#

cloneEmbeddable<T>(data): T

Type parameters#

Name
T

Parameters#

NameType
dataT

Returns#

T

Overrides#

Platform.cloneEmbeddable

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:89


convertsJsonAutomatically#

convertsJsonAutomatically(marshall?): boolean

Parameters#

NameTypeDefault value
marshallbooleanfalse

Returns#

boolean

Inherited from#

Platform.convertsJsonAutomatically

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

Inherited from#

Platform.denormalizePrimaryKey

Defined in#

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


extractSimpleType#

extractSimpleType(type): string

Parameters#

NameType
typestring

Returns#

string

Inherited from#

Platform.extractSimpleType

Defined in#

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


formatQuery#

formatQuery(sql, params): string

Parameters#

NameType
sqlstring
paramsreadonly any[]

Returns#

string

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:52


getArrayDeclarationSQL#

getArrayDeclarationSQL(): string

Returns#

string

Inherited from#

Platform.getArrayDeclarationSQL

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

Inherited from#

Platform.getBigIntTypeDeclarationSQL

Defined in#

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


getBlobDeclarationSQL#

getBlobDeclarationSQL(): string

Returns#

string

Inherited from#

Platform.getBlobDeclarationSQL

Defined in#

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


getBooleanTypeDeclarationSQL#

getBooleanTypeDeclarationSQL(): string

Returns#

string

Inherited from#

Platform.getBooleanTypeDeclarationSQL

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

Inherited from#

Platform.getCurrentTimestampSQL

Defined in#

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


getDateTimeTypeDeclarationSQL#

getDateTimeTypeDeclarationSQL(column): string

Parameters#

NameType
columnObject
column.length?number

Returns#

string

Inherited from#

Platform.getDateTimeTypeDeclarationSQL

Defined in#

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


getDateTypeDeclarationSQL#

getDateTypeDeclarationSQL(length?): string

Parameters#

NameType
length?number

Returns#

string

Inherited from#

Platform.getDateTypeDeclarationSQL

Defined in#

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


getDecimalTypeDeclarationSQL#

getDecimalTypeDeclarationSQL(column): string

Parameters#

NameType
columnObject
column.precision?number
column.scale?number

Returns#

string

Inherited from#

Platform.getDecimalTypeDeclarationSQL

Defined in#

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


getDefaultCharset#

getDefaultCharset(): string

Returns#

string

Inherited from#

Platform.getDefaultCharset

Defined in#

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


getDefaultIntegrityRule#

getDefaultIntegrityRule(): string

Returns#

string

Inherited from#

Platform.getDefaultIntegrityRule

Defined in#

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


getDefaultVersionLength#

getDefaultVersionLength(): number

Returns#

number

Inherited from#

Platform.getDefaultVersionLength

Defined in#

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


getDoubleDeclarationSQL#

getDoubleDeclarationSQL(): string

Returns#

string

Inherited from#

Platform.getDoubleDeclarationSQL

Defined in#

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


getEntityGenerator#

getEntityGenerator(em): any

Parameters#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns#

any

Overrides#

Platform.getEntityGenerator

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:30


getEnumTypeDeclarationSQL#

getEnumTypeDeclarationSQL(column): string

Parameters#

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

Returns#

string

Inherited from#

Platform.getEnumTypeDeclarationSQL

Defined in#

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


getExceptionConverter#

getExceptionConverter(): ExceptionConverter

Returns#

ExceptionConverter

Inherited from#

Platform.getExceptionConverter

Defined in#

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


getFloatDeclarationSQL#

getFloatDeclarationSQL(): string

Returns#

string

Inherited from#

Platform.getFloatDeclarationSQL

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

Inherited from#

Platform.getIndexName

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

Inherited from#

Platform.getIntegerTypeDeclarationSQL

Defined in#

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


getJsonDeclarationSQL#

getJsonDeclarationSQL(): string

Returns#

string

Inherited from#

Platform.getJsonDeclarationSQL

Defined in#

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


getMappedType#

getMappedType(type): Type<unknown, unknown>

Parameters#

NameType
typestring

Returns#

Type<unknown, unknown>

Inherited from#

Platform.getMappedType

Defined in#

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


getMigrator#

getMigrator(em): any

Parameters#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns#

any

Overrides#

Platform.getMigrator

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:36


getNamingStrategy#

getNamingStrategy(): () => NamingStrategy

Returns#

fn

new getNamingStrategy()

Inherited from#

Platform.getNamingStrategy

Defined in#

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


getRegExpOperator#

getRegExpOperator(): string

Returns#

string

Inherited from#

Platform.getRegExpOperator

Defined in#

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


getRepositoryClass#

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

Type parameters#

Name
T

Returns#

Constructor<EntityRepository<T>>

Overrides#

Platform.getRepositoryClass

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:18


getSchemaGenerator#

getSchemaGenerator(em): SchemaGenerator

Parameters#

NameType
emEntityManager<IDatabaseDriver<Connection>>

Returns#

SchemaGenerator

Overrides#

Platform.getSchemaGenerator

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:26


getSchemaHelper#

getSchemaHelper(): undefined | SchemaHelper

Returns#

undefined | SchemaHelper

Overrides#

Platform.getSchemaHelper

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:22


getSearchJsonPropertyKey#

getSearchJsonPropertyKey(path, type): string

Parameters#

NameType
pathstring[]
typestring

Returns#

string

Inherited from#

Platform.getSearchJsonPropertyKey

Defined in#

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


getSearchJsonPropertySQL#

getSearchJsonPropertySQL(path, type): string

Parameters#

NameType
pathstring
typestring

Returns#

string

Overrides#

Platform.getSearchJsonPropertySQL

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:85


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

Inherited from#

Platform.getSerializedPrimaryKeyField

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

Inherited from#

Platform.getSmallIntTypeDeclarationSQL

Defined in#

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


getTextTypeDeclarationSQL#

getTextTypeDeclarationSQL(_column): string

Parameters#

NameType
_columnObject
_column.length?number

Returns#

string

Inherited from#

Platform.getTextTypeDeclarationSQL

Defined in#

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


getTimeTypeDeclarationSQL#

getTimeTypeDeclarationSQL(length?): string

Parameters#

NameType
length?number

Returns#

string

Inherited from#

Platform.getTimeTypeDeclarationSQL

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

Inherited from#

Platform.getTinyIntTypeDeclarationSQL

Defined in#

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


getUuidTypeDeclarationSQL#

getUuidTypeDeclarationSQL(column): string

Parameters#

NameType
columnObject
column.length?number

Returns#

string

Inherited from#

Platform.getUuidTypeDeclarationSQL

Defined in#

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


getVarcharTypeDeclarationSQL#

getVarcharTypeDeclarationSQL(column): string

Parameters#

NameType
columnObject
column.length?number

Returns#

string

Inherited from#

Platform.getVarcharTypeDeclarationSQL

Defined in#

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


indexForeignKeys#

indexForeignKeys(): boolean

Returns#

boolean

Overrides#

Platform.indexForeignKeys

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:14


isBigIntProperty#

isBigIntProperty(prop): boolean

Parameters#

NameType
propEntityProperty<any>

Returns#

boolean

Inherited from#

Platform.isBigIntProperty

Defined in#

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


isNumericColumn#

isNumericColumn(mappedType): boolean

Parameters#

NameType
mappedTypeType<unknown, unknown>

Returns#

boolean

Inherited from#

Platform.isNumericColumn

Defined in#

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


isRaw#

isRaw(value): boolean

Parameters#

NameType
valueany

Returns#

boolean

Overrides#

Platform.isRaw

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:93


marshallArray#

marshallArray(values): string

Parameters#

NameType
valuesstring[]

Returns#

string

Inherited from#

Platform.marshallArray

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

Inherited from#

Platform.normalizePrimaryKey

Defined in#

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


processDateProperty#

processDateProperty(value): string | number | Date

Parameters#

NameType
valueunknown

Returns#

string | number | Date

Inherited from#

Platform.processDateProperty

Defined in#

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


quoteIdentifier#

quoteIdentifier(id, quote?): string

Parameters#

NameTypeDefault value
idstringundefined
quotestring'`'

Returns#

string

Inherited from#

Platform.quoteIdentifier

Defined in#

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


quoteValue#

quoteValue(value): string

Parameters#

NameType
valueany

Returns#

string

Overrides#

Platform.quoteValue

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:42


quoteVersionValue#

quoteVersionValue(value, prop): string | number | Date

Parameters#

NameType
valuenumber | Date
propEntityProperty<any>

Returns#

string | number | Date

Inherited from#

Platform.quoteVersionValue

Defined in#

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


requiresValuesKeyword#

requiresValuesKeyword(): boolean

Returns#

boolean

Inherited from#

Platform.requiresValuesKeyword

Defined in#

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


setConfig#

setConfig(config): void

Parameters#

NameType
configConfiguration<IDatabaseDriver<Connection>>

Returns#

void

Inherited from#

Platform.setConfig

Defined in#

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


supportsSchemas#

supportsSchemas(): boolean

Returns#

boolean

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:97


supportsTransactions#

supportsTransactions(): boolean

Returns#

boolean

Inherited from#

Platform.supportsTransactions

Defined in#

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


supportsUnsigned#

supportsUnsigned(): boolean

Returns#

boolean

Inherited from#

Platform.supportsUnsigned

Defined in#

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


unmarshallArray#

unmarshallArray(value): string[]

Parameters#

NameType
valuestring

Returns#

string[]

Inherited from#

Platform.unmarshallArray

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

Inherited from#

Platform.usesBatchInserts

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

Inherited from#

Platform.usesBatchUpdates

Defined in#

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


usesCascadeStatement#

usesCascadeStatement(): boolean

Returns#

boolean

Inherited from#

Platform.usesCascadeStatement

Defined in#

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


usesDefaultKeyword#

usesDefaultKeyword(): boolean

Returns#

boolean

Inherited from#

Platform.usesDefaultKeyword

Defined in#

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


usesDifferentSerializedPrimaryKey#

usesDifferentSerializedPrimaryKey(): boolean

Returns#

boolean

Inherited from#

Platform.usesDifferentSerializedPrimaryKey

Defined in#

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


usesImplicitTransactions#

usesImplicitTransactions(): boolean

Returns#

boolean

Inherited from#

Platform.usesImplicitTransactions

Defined in#

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


usesPivotTable#

usesPivotTable(): boolean

Returns#

boolean

Overrides#

Platform.usesPivotTable

Defined in#

packages/knex/src/AbstractSqlPlatform.ts:10


usesReturningStatement#

usesReturningStatement(): boolean

Returns#

boolean

Inherited from#

Platform.usesReturningStatement

Defined in#

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