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

optionalinheritedcharset

charset?: string

optionalinheritedclientUrl

clientUrl?: string

optionalinheritedcollate

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

optionalinheriteddbName

dbName?: string

debug

debug: boolean | LoggerNamespace[]

optionaldisableIdentityMap

disableIdentityMap?: boolean

optionaldisableTransactions

disableTransactions?: boolean

discovery

optionaldriver

optionalinheriteddriverOptions

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

optionalinheritedhost

host?: string

hydrator

hydrator: HydratorConstructor

ignoreDeprecations

ignoreDeprecations: boolean | string[]

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

optionalinheritedmultipleStatements

multipleStatements?: boolean

optionalinheritedname

name?: string

optionalnamingStrategy

namingStrategy?: new () => NamingStrategy

Type declaration

onQuery

onQuery: (sql: string, params: unknown[]) => string

Type declaration

    • (sql: string, params: unknown[]): string
    • Parameters

      • sql: string
      • params: unknown[]

      Returns string

optionalinheritedpassword

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

persistOnCreate

persistOnCreate: boolean

optionalinheritedpool

pool?: PoolConfig

populateAfterFlush

populateAfterFlush: boolean

optionalpopulateWhere

populateWhere?: PopulateHint | infer | all

optionalinheritedport

port?: number

preferReadReplicas

preferReadReplicas: boolean

optionalpreferTs

preferTs?: boolean

Using this option, you can force the ORM to use the TS options regardless of whether the TypeScript support is detected or not. This effectively means using entitiesTs for discovery and pathTs for migrations and seeders. Should be used only for tests and stay disabled for production builds.

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

optionalinheritedschema

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
@deprecated

use preferTs instead

upsertManaged

upsertManaged: boolean

optionaluseBatchInserts

useBatchInserts?: boolean

optionaluseBatchUpdates

useBatchUpdates?: boolean

optionalinheriteduser

user?: string

validate

validate: boolean

validateRequired

validateRequired: boolean

verbose

verbose: boolean