Configuration <D, EM>
Index
Constructors
constructor
Parameters
options: Options<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>
validate: boolean = true
Returns Configuration<D, EM>
Properties
staticreadonlyDEFAULTS
Type declaration
allowGlobalContext: false
assign: { mergeEmbeddedProperties: true; mergeObjectProperties: false; updateByPrimaryKey: true; updateNestedEntities: true }
mergeEmbeddedProperties: true
mergeObjectProperties: false
updateByPrimaryKey: true
updateNestedEntities: true
autoJoinOneToOneOwner: true
autoJoinRefsForFilters: true
baseDir: string
batchSize: number
colors: true
connect: true
context: (name: string) => undefined | EntityManager<IDatabaseDriver<Connection>>
Parameters
name: string
Returns undefined | EntityManager<IDatabaseDriver<Connection>>
contextName: string
dataloader: NONE
debug: false
discovery: { alwaysAnalyseProperties: true; checkDuplicateEntities: true; checkDuplicateFieldNames: true; checkDuplicateTableNames: true; checkNonPersistentCompositeProps: true; disableDynamicFileAccess: false; inferDefaultValues: true; requireEntitiesArray: false; warnWhenNoEntities: true }
alwaysAnalyseProperties: true
checkDuplicateEntities: true
checkDuplicateFieldNames: true
checkDuplicateTableNames: true
checkNonPersistentCompositeProps: true
disableDynamicFileAccess: false
inferDefaultValues: true
requireEntitiesArray: false
warnWhenNoEntities: true
driverOptions: {}
dynamicImportProvider: (id: string) => Promise<any>
Parameters
id: string
Returns Promise<any>
embeddables: { prefixMode: absolute }
prefixMode: absolute
ensureDatabase: true
ensureIndexes: false
entities: never[]
entitiesTs: never[]
entityGenerator: { bidirectionalRelations: false; fileName: (className: string) => string; forceUndefined: true; identifiedReferences: false; onlyPurePivotTables: false; outputPurePivotTables: false; readOnlyPivotTables: false; scalarPropertiesForRelations: never; scalarTypeInDecorator: false; undefinedDefaults: false; useCoreBaseEntity: false }
bidirectionalRelations: false
fileName: (className: string) => string
Parameters
className: string
Returns string
forceUndefined: true
identifiedReferences: false
onlyPurePivotTables: false
outputPurePivotTables: false
readOnlyPivotTables: false
scalarPropertiesForRelations: never
scalarTypeInDecorator: false
undefinedDefaults: false
useCoreBaseEntity: false
extensions: never[]
filters: {}
findExactlyOneOrFailHandler: (entityName: string, where: IPrimaryKeyValue | Dictionary) => NotFoundError<Partial<any>>
Parameters
entityName: string
where: IPrimaryKeyValue | Dictionary
Returns NotFoundError<Partial<any>>
findOneOrFailHandler: (entityName: string, where: IPrimaryKeyValue | Dictionary) => NotFoundError<Partial<any>>
Parameters
entityName: string
where: IPrimaryKeyValue | Dictionary
Returns NotFoundError<Partial<any>>
flushMode: AUTO
forceEntityConstructor: false
forceUndefined: false
highlighter: NullHighlighter
hydrator: typeof ObjectHydrator
ignoreDeprecations: false
ignoreUndefinedInQuery: false
loadStrategy: JOINED
logger: (message?: any, ...optionalParams: any[]) => void
Parameters
optionalmessage: any
rest...optionalParams: any[]
Returns void
metadataCache: { adapter: typeof FileCacheAdapter; options: { cacheDir: string }; pretty: false }
adapter: typeof FileCacheAdapter
options: { cacheDir: string }
cacheDir: string
pretty: false
metadataProvider: typeof ReflectMetadataProvider
migrations: { allOrNothing: true; disableForeignKeys: false; dropTables: true; emit: ts; fileName: (timestamp: string, name?: string) => string; glob: string; path: string; safe: false; silent: false; snapshot: true; tableName: string; transactional: true }
allOrNothing: true
disableForeignKeys: false
dropTables: true
emit: ts
fileName: (timestamp: string, name?: string) => string
Parameters
timestamp: string
optionalname: string
Returns string
glob: string
path: string
safe: false
silent: false
snapshot: true
tableName: string
transactional: true
onQuery: (sql: string) => string
Parameters
sql: string
Returns string
persistOnCreate: true
pool: {}
populateAfterFlush: true
populateWhere: ALL
preferReadReplicas: true
propagationOnPrototype: true
resultCache: { adapter: typeof MemoryCacheAdapter; expiration: number; options: {} }
adapter: typeof MemoryCacheAdapter
expiration: number
options: {}
schemaGenerator: { createForeignKeyConstraints: true; disableForeignKeys: false; ignoreSchema: never[] }
createForeignKeyConstraints: true
disableForeignKeys: false
ignoreSchema: never[]
seeder: { defaultSeeder: string; emit: ts; fileName: (className: string) => string; glob: string; path: string }
defaultSeeder: string
emit: ts
fileName: (className: string) => string
Parameters
className: string
Returns string
glob: string
path: string
serialization: { includePrimaryKeys: true }
includePrimaryKeys: true
strict: false
subscribers: never[]
upsertManaged: true
validate: false
validateRequired: true
verbose: false
Methods
get
Gets specific configuration option. Falls back to specified
defaultValue
if provided.Parameters
key: T
optionaldefaultValue: U
Returns U
getAll
Returns MikroORMOptions<D, EM>
getCachedService
Creates instance of given service and caches it.
Parameters
cls: T
rest...args: ConstructorParameters<T>
Returns InstanceType<T>
getClientUrl
Gets current client URL (connection string).
Parameters
hidePassword: boolean = false
Returns string
getComparator
Gets instance of Comparator. (cached)
Parameters
metadata: MetadataStorage
Returns EntityComparator
getDriver
Gets current database driver instance.
Returns D
getExtension
Parameters
name: string
Returns undefined | T
getHydrator
Gets instance of Hydrator. (cached)
Parameters
metadata: MetadataStorage
Returns IHydrator
getLogger
Gets Logger instance.
Returns Logger
getMetadataCacheAdapter
Gets instance of metadata CacheAdapter. (cached)
Returns SyncCacheAdapter
getMetadataProvider
Gets instance of MetadataProvider. (cached)
Returns MetadataProvider
getNamingStrategy
Gets instance of NamingStrategy. (cached)
Returns NamingStrategy
getRepositoryClass
Gets EntityRepository class to be instantiated.
Parameters
repository: () => EntityClass<EntityRepository<Partial<any>>>
Returns undefined | EntityClass<EntityRepository<any>>
getResultCacheAdapter
Gets instance of CacheAdapter for result cache. (cached)
Returns CacheAdapter
registerExtension
Parameters
name: string
cb: () => unknown
Returns void
reset
Resets the configuration to its default value
Parameters
key: T
Returns void
resetServiceCache
Returns void
set
Overrides specified configuration value.
Parameters
key: T
value: U
Returns void
Prints to
stdout
with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar toprintf(3)
(the arguments are all passed toutil.format()
).See
util.format()
for more information.v0.1.100