Skip to main content
Version: Next

MikroORMOptions <D, EM>

Hierarchy

Index

Properties

allowGlobalContext

allowGlobalContext: boolean

assign

assign: AssignOptions<boolean>

autoJoinOneToOneOwner

autoJoinOneToOneOwner: boolean

autoJoinRefsForFilters

autoJoinRefsForFilters: boolean

baseDir

baseDir: string

batchSize

batchSize: number

optionalcharset

charset?: string

optionalclientUrl

clientUrl?: string

optionalcollate

collate?: string

optionalcolors

colors?: boolean

connect

connect: boolean

context

context: (name: string) => undefined | EntityManager<IDatabaseDriver<Connection>>

Type declaration

contextName

contextName: string

dataloader

dataloader: boolean | DataloaderType

optionaldbName

dbName?: string

debug

debug: boolean | LoggerNamespace[]

optionaldisableIdentityMap

disableIdentityMap?: boolean

optionaldisableTransactions

disableTransactions?: boolean

discovery

optionaldriver

optionaldriverOptions

driverOptions?: Dictionary

dynamicImportProvider

dynamicImportProvider: (id: string) => Promise<unknown>

Type declaration

    • (id: string): Promise<unknown>
    • Parameters

      • id: string

      Returns Promise<unknown>

embeddables

embeddables: { prefixMode: EmbeddedPrefixMode }

Type declaration

ensureDatabase

ensureDatabase: boolean | EnsureDatabaseOptions

ensureIndexes

ensureIndexes: boolean

entities

entities: (string | EntityClass<Partial<any>> | EntityClassGroup<Partial<any>> | EntitySchema<any, never>)[]

entitiesTs

entitiesTs: (string | EntityClass<Partial<any>> | EntityClassGroup<Partial<any>> | EntitySchema<any, never>)[]

entityGenerator

entityGenerator: GenerateOptions

optionalentityManager

entityManager?: Constructor<EM>

optionalentityRepository

entityRepository?: EntityClass<EntityRepository<any>>

extensions

extensions: { register: (orm: MikroORM<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>) => void }[]

filters

filters: Dictionary<{ name?: string } & Omit<FilterDef, name>>

findExactlyOneOrFailHandler

findExactlyOneOrFailHandler: (entityName: string, where: IPrimaryKeyValue | Dictionary) => Error

Type declaration

    • (entityName: string, where: IPrimaryKeyValue | Dictionary): Error
    • Parameters

      • entityName: string
      • where: IPrimaryKeyValue | Dictionary

      Returns Error

findOneOrFailHandler

findOneOrFailHandler: (entityName: string, where: IPrimaryKeyValue | Dictionary) => Error

Type declaration

    • (entityName: string, where: IPrimaryKeyValue | Dictionary): Error
    • Parameters

      • entityName: string
      • where: IPrimaryKeyValue | Dictionary

      Returns Error

flushMode

flushMode: always | FlushMode | commit | auto

forceEntityConstructor

forceEntityConstructor: boolean | (string | Constructor<Partial<any>>)[]

forceUndefined

forceUndefined: boolean

optionalforceUtcTimezone

forceUtcTimezone?: boolean

highlighter

highlighter: Highlighter

optionalhost

host?: string

hydrator

hydrator: HydratorConstructor

optionalignoreUndefinedInQuery

ignoreUndefinedInQuery?: boolean

optionalimplicitTransactions

implicitTransactions?: boolean

loadStrategy

loadStrategy: LoadStrategy | select-in | joined

logger

logger: (message: string) => void

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

optionalloggerFactory

loggerFactory?: (options: LoggerOptions) => Logger

Type declaration

metadataCache

metadataCache: { adapter?: new (...params: any[]) => SyncCacheAdapter; combined?: string | boolean; enabled?: boolean; options?: Dictionary; pretty?: boolean }

Type declaration

metadataProvider

migrations

migrations: MigrationsOptions

optionalmultipleStatements

multipleStatements?: boolean

optionalname

name?: string

optionalnamingStrategy

namingStrategy?: new () => NamingStrategy

Type declaration

optionalpassword

password?: string | () => MaybePromise<string> | MaybePromise<DynamicPassword>

persistOnCreate

persistOnCreate: boolean

optionalpool

pool?: PoolConfig

populateAfterFlush

populateAfterFlush: boolean

optionalpopulateWhere

populateWhere?: PopulateHint | infer | all

optionalport

port?: number

preferReadReplicas

preferReadReplicas: boolean

propagationOnPrototype

propagationOnPrototype: boolean

optionalreplicas

replicas?: ConnectionOptions[]

resultCache

resultCache: { adapter?: new (...params: any[]) => CacheAdapter; expiration?: number; global?: number | boolean | [string, number]; options?: Dictionary }

Type declaration

  • optionaladapter?: new (...params: any[]) => CacheAdapter
  • optionalexpiration?: number
  • optionalglobal?: number | boolean | [string, number]
  • optionaloptions?: Dictionary

optionalschema

schema?: string

schemaGenerator

schemaGenerator: { createForeignKeyConstraints?: boolean; disableForeignKeys?: boolean; ignoreSchema?: string[]; managementDbName?: string }

Type declaration

  • optionalcreateForeignKeyConstraints?: boolean
  • optionaldisableForeignKeys?: boolean
  • optionalignoreSchema?: string[]
  • optionalmanagementDbName?: string

seeder

serialization

serialization: { forceObject?: boolean; includePrimaryKeys?: boolean }

Type declaration

  • optionalforceObject?: boolean

    Enforce unpopulated references to be returned as objects, e.g. { author: { id: 1 } } instead of { author: 1 }.

  • optionalincludePrimaryKeys?: boolean

strict

strict: boolean

subscribers

subscribers: (EventSubscriber<any> | Constructor<EventSubscriber<any>>)[]

optionaltimezone

timezone?: string

optionaltsNode

tsNode?: boolean

optionaluseBatchInserts

useBatchInserts?: boolean

optionaluseBatchUpdates

useBatchUpdates?: boolean

optionaluser

user?: string

validate

validate: boolean

validateRequired

validateRequired: boolean

verbose

verbose: boolean