MongoPlatform
Hierarchy
- Platform
- MongoPlatform
Index
Constructors
Methods
- allowsComparingTuples
- allowsMultiInsert
- cloneEmbeddable
- convertDateToJSValue
- convertIntervalToDatabaseValue
- convertIntervalToJSValue
- convertJsonToDatabaseValue
- convertJsonToJSValue
- convertsJsonAutomatically
- denormalizePrimaryKey
- 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
- isPopulated
- isRaw
- lookupExtensions
- marshallArray
- normalizePrimaryKey
- parseDate
- processDateProperty
- quoteIdentifier
- quoteValue
- quoteVersionValue
- setConfig
- shouldHaveColumn
- supportsCreatingFullTextIndex
- supportsCustomPrimaryKeyNames
- supportsDownMigrations
- supportsMultipleCascadePaths
- supportsMultipleStatements
- supportsNativeEnums
- supportsTransactions
- supportsUnsigned
- unmarshallArray
- usesBatchInserts
- usesBatchUpdates
- usesCascadeStatement
- usesDefaultKeyword
- usesDifferentSerializedPrimaryKey
- usesImplicitTransactions
- usesOutputStatement
- usesPivotTable
- usesReturningStatement
- validateMetadata
Constructors
constructor
Returns MongoPlatform
Methods
allowsComparingTuples
Returns boolean
allowsMultiInsert
Returns boolean
cloneEmbeddable
Type parameters
- T
Parameters
data: T
Returns T
convertDateToJSValue
Parameters
value: string | Date
Returns string
convertIntervalToDatabaseValue
Parameters
value: unknown
Returns unknown
convertIntervalToJSValue
Parameters
value: string
Returns unknown
convertJsonToDatabaseValue
Parameters
value: unknown
Returns unknown
convertJsonToJSValue
Parameters
value: unknown
prop: EntityProperty<any, any>
Returns unknown
convertsJsonAutomatically
Returns boolean
denormalizePrimaryKey
Parameters
data: string | number
Returns IPrimaryKeyValue
extractSimpleType
Parameters
type: string
Returns string
formatQuery
Parameters
sql: string
params: readonly any[]
Returns string
generateCustomOrder
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 void
getArrayDeclarationSQL
Returns string
getBigIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
getBlobDeclarationSQL
Returns string
getBooleanTypeDeclarationSQL
Returns string
getCharTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
getConfig
getCurrentTimestampSQL
Returns the SQL specific for the platform to get the current timestamp
Parameters
optionallength: number
Returns string
getDateTimeTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
getDateTypeDeclarationSQL
Parameters
optionallength: number
Returns string
getDecimalTypeDeclarationSQL
Parameters
column: { precision?: number; scale?: number }
optionalprecision: number
optionalscale: number
Returns string
getDefaultCharLength
Returns number
getDefaultCharset
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
getDefaultVarcharLength
Returns number
getDefaultVersionLength
Returns number
getDoubleDeclarationSQL
Returns string
getEnumTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; fieldNames: string[]; items?: unknown[]; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
fieldNames: string[]
optionalitems: unknown[]
optionallength: number
optionalunsigned: boolean
Returns string
getExceptionConverter
Returns ExceptionConverter
getExtension
Type parameters
- T
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
Parameters
tableName: string
columns: string[]
type: primary | index | unique | foreign | sequence
Returns string
getIntegerTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
getIntervalTypeDeclarationSQL
Parameters
column: { length?: number }
optionallength: number
Returns string
getJsonDeclarationSQL
Returns string
getJsonIndexDefinition
Parameters
index: { columnNames: string[] }
columnNames: string[]
Returns string[]
getMappedType
Parameters
type: string
Returns Type<unknown, unknown>
getMediumIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
getNamingStrategy
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
getRepositoryClass
Type parameters
- T: object
Returns Constructor<EntityRepository<T>>
getSchemaGenerator
Parameters
driver: IDatabaseDriver<Connection>
optionalem: EntityManager<IDatabaseDriver<Connection>>
Returns MongoSchemaGenerator
getSchemaHelper
Returns unknown
getSearchJsonPropertyKey
Parameters
path: string[]
type: string
aliased: boolean
optionalvalue: unknown
Returns string
getSearchJsonPropertySQL
Parameters
path: string
type: string
aliased: boolean
Returns string
getSerializedPrimaryKeyField
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
getSmallIntTypeDeclarationSQL
Parameters
column: { autoincrement?: boolean; length?: number; unsigned?: boolean }
optionalautoincrement: boolean
optionallength: number
optionalunsigned: boolean
Returns string
getTextTypeDeclarationSQL
Parameters
_column: { length?: number }
optionallength: number
Returns string
getTimeTypeDeclarationSQL
Parameters
optionallength: number
Returns string
getTimezone
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
isAllowedTopLevelOperator
Parameters
operator: string
Returns boolean
isBigIntProperty
Parameters
prop: EntityProperty<any, any>
Returns boolean
isNumericColumn
Parameters
mappedType: Type<unknown, unknown>
Returns boolean
isPopulated
Type parameters
- T
Parameters
key: string
populate: boolean | PopulateOptions<T>[]
Returns boolean
isRaw
Parameters
value: any
Returns boolean
lookupExtensions
Allows registering extensions of the driver automatically (e.g.
SchemaGenerator
extension in SQL drivers).Parameters
Returns void
marshallArray
Parameters
values: string[]
Returns string
normalizePrimaryKey
parseDate
Parameters
value: string | number
Returns Date
processDateProperty
Parameters
value: unknown
Returns string | number | Date
quoteIdentifier
Parameters
id: string
quote: string = '`'
Returns string
quoteValue
Parameters
value: any
Returns string
quoteVersionValue
Parameters
value: number | Date
prop: EntityProperty<any, any>
Returns string | number | Date
setConfig
Parameters
Returns void
shouldHaveColumn
Type parameters
- T
Parameters
prop: EntityProperty<T, any>
populate: PopulateOptions<T>[]
optionalexclude: string[]
Returns boolean
supportsCreatingFullTextIndex
Returns boolean
supportsCustomPrimaryKeyNames
Returns boolean
supportsDownMigrations
Currently not supported due to how knex does complex sqlite diffing (always based on current schema)
Returns boolean
supportsMultipleCascadePaths
Returns boolean
supportsMultipleStatements
Returns boolean
supportsNativeEnums
for postgres native enums
Returns boolean
supportsTransactions
Returns boolean
supportsUnsigned
Returns boolean
unmarshallArray
Parameters
value: string
Returns string[]
usesBatchInserts
Whether or not the driver supports retuning list of created PKs back when multi-inserting
Returns boolean
usesBatchUpdates
Whether or not the driver supports updating many records at once
Returns boolean
usesCascadeStatement
Returns boolean
usesDefaultKeyword
Returns boolean
usesDifferentSerializedPrimaryKey
Returns boolean
usesImplicitTransactions
Returns boolean
usesOutputStatement
Returns boolean
usesPivotTable
Returns boolean
usesReturningStatement
Returns boolean
validateMetadata
Parameters
meta: EntityMetadata<any>
Returns void
Converts scalar primary key representation to native driver wrapper (e.g. string to mongodb's ObjectId)