PostgreSqlPlatform
Hierarchy
- AbstractSqlPlatform
- PostgreSqlPlatform
Index
Constructors
Methods
- allowsComparingTuples
- allowsMultiInsert
- castColumn
- cloneEmbeddable
- convertDateToJSValue
- convertIntervalToDatabaseValue
- convertIntervalToJSValue
- convertJsonToDatabaseValue
- convertJsonToJSValue
- convertsJsonAutomatically
- denormalizePrimaryKey
- escape
- extractSimpleType
- formatQuery
- generateCustomOrder
- getArrayDeclarationSQL
- getBigIntTypeDeclarationSQL
- getBlobDeclarationSQL
- getBooleanTypeDeclarationSQL
- getCharTypeDeclarationSQL
- getConfig
- getCurrentTimestampSQL
- getDateTimeTypeDeclarationSQL
- getDateTypeDeclarationSQL
- getDecimalTypeDeclarationSQL
- getDefaultCharLength
- getDefaultCharset
- getDefaultDateTimeLength
- getDefaultMappedType
- getDefaultPrimaryName
- getDefaultSchemaName
- getDefaultVarcharLength
- getDefaultVersionLength
- getDoubleDeclarationSQL
- getEnumTypeDeclarationSQL
- getExceptionConverter
- getExtension
- getFloatDeclarationSQL
- getFullTextIndexExpression
- getFullTextWhereClause
- getIndexName
- getIntegerTypeDeclarationSQL
- getIntervalTypeDeclarationSQL
- getJsonDeclarationSQL
- getJsonIndexDefinition
- getMappedType
- getMediumIntTypeDeclarationSQL
- getNamingStrategy
- getRegExpOperator
- getRegExpValue
- getRepositoryClass
- getSchemaGenerator
- getSchemaHelper
- getSearchJsonPropertyKey
- getSearchJsonPropertySQL
- getSerializedPrimaryKeyField
- getSmallIntTypeDeclarationSQL
- getTextTypeDeclarationSQL
- getTimeTypeDeclarationSQL
- getTimezone
- getTinyIntTypeDeclarationSQL
- getUuidTypeDeclarationSQL
- getVarcharTypeDeclarationSQL
- indexForeignKeys
- isAllowedTopLevelOperator
- isBigIntProperty
- isNumericColumn
- isNumericProperty
- isPopulated
- isRaw
- lookupExtensions
- marshallArray
- normalizeColumnType
- normalizePrimaryKey
- parseDate
- processDateProperty
- quoteIdentifier
- quoteValue
- quoteVersionValue
- setConfig
- shouldHaveColumn
- supportsCreatingFullTextIndex
- supportsCustomPrimaryKeyNames
- supportsDownMigrations
- supportsMultipleCascadePaths
- supportsMultipleStatements
- supportsNativeEnums
- supportsSchemas
- supportsTransactions
- supportsUnsigned
- unmarshallArray
- usesBatchInserts
- usesBatchUpdates
- usesCascadeStatement
- usesDefaultKeyword
- usesDifferentSerializedPrimaryKey
- usesImplicitTransactions
- usesOutputStatement
- usesPivotTable
- usesReturningStatement
- validateMetadata
Constructors
constructor
Returns PostgreSqlPlatform
Methods
inheritedallowsComparingTuples
Returns boolean
inheritedallowsMultiInsert
Returns boolean
castColumn
Parameters
optionalprop: { columnTypes?: string[] }
optionalcolumnTypes: string[]
Returns string
inheritedcloneEmbeddable
Parameters
data: T
Returns T
inheritedconvertDateToJSValue
Parameters
value: string | Date
Returns string
convertIntervalToDatabaseValue
Parameters
value: IPostgresInterval
Returns unknown
convertIntervalToJSValue
Parameters
value: string
Returns unknown
inheritedconvertJsonToDatabaseValue
Parameters
value: unknown
optionalcontext: TransformContext
Returns unknown
inheritedconvertJsonToJSValue
Parameters
value: unknown
prop: EntityProperty<any, any>
Returns unknown
inheritedconvertsJsonAutomatically
Returns boolean
inheriteddenormalizePrimaryKey
Converts scalar primary key representation to native driver wrapper (e.g. string to mongodb's ObjectId)
Parameters
data: IPrimaryKeyValue
Returns IPrimaryKeyValue
escape
Parameters
value: any
Returns string
inheritedextractSimpleType
Parameters
type: string
Returns string
inheritedformatQuery
Parameters
sql: string
params: readonly any[]
Returns string
inheritedgenerateCustomOrder
Generates a custom order by statement given a set of in order values, eg. ORDER BY (CASE WHEN priority = 'low' THEN 1 WHEN priority = 'medium' THEN 2 ELSE NULL END)
Parameters
escapedColumn: string
values: unknown[]
Returns string
getArrayDeclarationSQL
Returns string
getBigIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean }
optionalautoincrement: boolean
Returns string
getBlobDeclarationSQL
Returns string
inheritedgetBooleanTypeDeclarationSQL
Returns string
getCharTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
inheritedgetConfig
getCurrentTimestampSQL
Returns the SQL specific for the platform to get the current timestamp
Parameters
length: number
Returns string
getDateTimeTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
inheritedgetDateTypeDeclarationSQL
Parameters
optionallength: number
Returns string
inheritedgetDecimalTypeDeclarationSQL
Parameters
column: { precision?: number; scale?: number }
optionalprecision: number
optionalscale: number
Returns string
inheritedgetDefaultCharLength
Returns number
inheritedgetDefaultCharset
Returns string
getDefaultDateTimeLength
Returns number
getDefaultMappedType
Parameters
type: string
Returns Type<unknown, unknown>
getDefaultPrimaryName
Parameters
tableName: string
columns: string[]
Returns string
getDefaultSchemaName
Returns undefined | string
inheritedgetDefaultVarcharLength
Returns number
inheritedgetDefaultVersionLength
Returns number
getDoubleDeclarationSQL
Returns string
getEnumTypeDeclarationSQL
Parameters
column: { fieldNames: string[]; items?: unknown[]; nativeEnumName?: string }
fieldNames: string[]
optionalitems: unknown[]
optionalnativeEnumName: string
Returns string
inheritedgetExceptionConverter
Returns ExceptionConverter
inheritedgetExtension
Parameters
extensionName: string
extensionKey: string
moduleName: string
em: EntityManager<IDatabaseDriver<Connection>>
Returns T
getFloatDeclarationSQL
Returns string
getFullTextIndexExpression
Parameters
indexName: string
schemaName: undefined | string
tableName: string
columns: SimpleColumnMeta[]
Returns string
getFullTextWhereClause
Parameters
prop: EntityProperty<any, any>
Returns string
getIndexName
Returns the default name of index for the given columns cannot go past 63 character length for identifiers in MySQL
Parameters
tableName: string
columns: string[]
type: primary | index | unique | foreign | sequence
Returns string
getIntegerTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; generated?: string; length?: number }
optionalautoincrement: boolean
optionalgenerated: string
optionallength: number
Returns string
getIntervalTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
getJsonDeclarationSQL
Returns string
getJsonIndexDefinition
Parameters
index: IndexDef
Returns string[]
getMappedType
Parameters
type: string
Returns Type<unknown, unknown>
inheritedgetMediumIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
inheritedgetNamingStrategy
Returns new () => NamingStrategy
Returns NamingStrategy
getRegExpOperator
Parameters
optionalval: unknown
optionalflags: string
Returns string
getRegExpValue
Parameters
val: RegExp
Returns { $flags?: string; $re: string }
optional$flags?: string
$re: string
inheritedgetRepositoryClass
Returns Constructor<EntityRepository<T>>
inheritedgetSchemaGenerator
Parameters
driver: IDatabaseDriver<Connection>
optionalem: EntityManager<IDatabaseDriver<Connection>>
Returns SqlSchemaGenerator
inheritedgetSchemaHelper
Returns undefined | SchemaHelper
getSearchJsonPropertyKey
Parameters
path: string[]
type: undefined | string | Type<string, string>
aliased: boolean
optionalvalue: unknown
Returns string
inheritedgetSearchJsonPropertySQL
Parameters
path: string
type: string
aliased: boolean
Returns string
inheritedgetSerializedPrimaryKeyField
Used when serializing via toObject and toJSON methods, allows to use different PK field name (like
id
instead of_id
)Parameters
field: string
Returns string
inheritedgetSmallIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
inheritedgetTextTypeDeclarationSQL
Parameters
_column: { length?: number }
optionallength: number
Returns string
getTimeTypeDeclarationSQL
Returns string
inheritedgetTimezone
Returns undefined | string
getTinyIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
getUuidTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
getVarcharTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
indexForeignKeys
Returns boolean
inheritedisAllowedTopLevelOperator
Parameters
operator: string
Returns boolean
isBigIntProperty
Parameters
prop: EntityProperty<any, any>
Returns boolean
inheritedisNumericColumn
Parameters
mappedType: Type<unknown, unknown>
Returns boolean
inheritedisNumericProperty
Parameters
prop: EntityProperty<any, any>
ignoreCustomType: boolean = false
Returns boolean
inheritedisPopulated
Parameters
key: string
populate: boolean | PopulateOptions<T>[]
Returns boolean
inheritedisRaw
Parameters
value: any
Returns boolean
inheritedlookupExtensions
Allows registering extensions of the driver automatically (e.g.
SchemaGenerator
extension in SQL drivers).Parameters
Returns void
marshallArray
Parameters
values: string[]
Returns string
normalizeColumnType
This should be used only to compare types, it can strip some information like the length.
Parameters
type: string
options: { autoincrement?: boolean; length?: number; precision?: number; scale?: number } = {}
optionalautoincrement: boolean
optionallength: number
optionalprecision: number
optionalscale: number
Returns string
inheritednormalizePrimaryKey
Normalizes primary key wrapper to scalar value (e.g. mongodb's ObjectId to string)
Parameters
data: IPrimaryKeyValue | Primary<T>
Returns T
parseDate
Parameters
value: string | number
Returns Date
inheritedprocessDateProperty
Parameters
value: unknown
Returns string | number | Date
quoteIdentifier
Parameters
id: string
quote: string = '"'
Returns string
inheritedquoteValue
Parameters
value: any
Returns string
inheritedquoteVersionValue
Parameters
value: number | Date
prop: EntityProperty<any, any>
Returns string | number | Date
setConfig
Parameters
Returns void
inheritedshouldHaveColumn
Parameters
prop: EntityProperty<T, any>
populate: boolean | PopulateOptions<T>[]
optionalexclude: string[]
includeFormulas: boolean = true
Returns boolean
supportsCreatingFullTextIndex
Returns boolean
supportsCustomPrimaryKeyNames
Returns boolean
inheritedsupportsDownMigrations
Currently not supported due to how knex does complex sqlite diffing (always based on current schema)
Returns boolean
inheritedsupportsMultipleCascadePaths
Returns boolean
supportsMultipleStatements
Returns boolean
supportsNativeEnums
for postgres native enums
Returns boolean
supportsSchemas
Returns boolean
inheritedsupportsTransactions
Returns boolean
inheritedsupportsUnsigned
Returns boolean
unmarshallArray
Parameters
value: string
Returns string[]
inheritedusesBatchInserts
Whether or not the driver supports retuning list of created PKs back when multi-inserting
Returns boolean
inheritedusesBatchUpdates
Whether or not the driver supports updating many records at once
Returns boolean
usesCascadeStatement
Returns boolean
inheritedusesDefaultKeyword
Returns boolean
inheritedusesDifferentSerializedPrimaryKey
Returns boolean
inheritedusesImplicitTransactions
Returns boolean
inheritedusesOutputStatement
Returns boolean
inheritedusesPivotTable
Returns boolean
usesReturningStatement
Returns boolean
inheritedvalidateMetadata
Parameters
meta: EntityMetadata<any>
Returns void