Skip to main content
Version: 5.3

MikroORMOptions <D>

Hierarchy

Index

Properties

allowGlobalContext

allowGlobalContext: boolean

autoJoinOneToOneOwner

autoJoinOneToOneOwner: boolean

baseDir

baseDir: string

batchSize

batchSize: number

cache

cache: { adapter?: new (...params: any[]) => CacheAdapter; enabled?: boolean; options?: Dictionary<any>; pretty?: boolean }

Type declaration

optionalcharset

charset?: string

optionalclientUrl

clientUrl?: string

optionalcollate

collate?: string

connect

connect: boolean

context

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

Type declaration

contextName

contextName: string

optionaldbName

dbName?: string

debug

debug: boolean | LoggerNamespace[]

discovery

discovery: { alwaysAnalyseProperties?: boolean; disableDynamicFileAccess?: boolean; getMappedType?: (type: string, platform: Platform) => undefined | Type<unknown, unknown>; requireEntitiesArray?: boolean; warnWhenNoEntities?: boolean }

Type declaration

  • optionalalwaysAnalyseProperties?: boolean
  • optionaldisableDynamicFileAccess?: boolean
  • optionalgetMappedType?: (type: string, platform: Platform) => undefined | Type<unknown, unknown>
      • (type: string, platform: Platform): undefined | Type<unknown, unknown>
      • Parameters

        Returns undefined | Type<unknown, unknown>

  • optionalrequireEntitiesArray?: boolean
  • optionalwarnWhenNoEntities?: boolean

optionaldriver

driver?: new (config: Configuration<IDatabaseDriver<Connection>>) => D

Type declaration

driverOptions

driverOptions: Dictionary<any>

ensureIndexes

ensureIndexes: boolean

entities

entities: (string | EntityClass<AnyEntity<any>> | EntityClassGroup<AnyEntity<any>> | EntitySchema<any, undefined>)[]

entitiesTs

entitiesTs: (string | EntityClass<AnyEntity<any>> | EntityClassGroup<AnyEntity<any>> | EntitySchema<any, undefined>)[]

entityGenerator

entityGenerator: { bidirectionalRelations?: boolean; entitySchema?: boolean; identifiedReferences?: boolean }

Type declaration

  • optionalbidirectionalRelations?: boolean
  • optionalentitySchema?: boolean
  • optionalidentifiedReferences?: boolean

optionalentityRepository

entityRepository?: Constructor<unknown>

filters

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

findExactlyOneOrFailHandler

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

Type declaration

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

      • entityName: string
      • where: Dictionary<any> | IPrimaryKeyValue

      Returns Error

findOneOrFailHandler

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

Type declaration

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

      • entityName: string
      • where: Dictionary<any> | IPrimaryKeyValue

      Returns Error

flushMode

flushMode: FlushMode

forceEntityConstructor

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

forceUndefined

forceUndefined: boolean

forceUtcTimezone

forceUtcTimezone: boolean

highlighter

highlighter: Highlighter

optionalhost

host?: string

hydrator

hydrator: HydratorConstructor

optionalimplicitTransactions

implicitTransactions?: boolean

loadStrategy

loadStrategy: LoadStrategy

logger

logger: (message: string) => void

Type declaration

    • (message: string): void
    • Parameters

      • message: string

      Returns void

optionalloggerFactory

loggerFactory?: (options: LoggerOptions) => Logger

Type declaration

metadataProvider

metadataProvider: new (config: Configuration<IDatabaseDriver<Connection>>) => 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

populateWhere

populateWhere: PopulateHint

optionalport

port?: number

preferReadReplicas

preferReadReplicas: boolean

propagateToOneOwner

propagateToOneOwner: boolean

optionalreplicas

replicas?: Partial<ConnectionOptions>[]

resultCache

resultCache: { adapter?: new (...params: any[]) => CacheAdapter; expiration?: number; options?: Dictionary<any> }

Type declaration

optionalschema

schema?: string

schemaGenerator

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

Type declaration

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

seeder

strict

strict: boolean

subscribers

subscribers: EventSubscriber<any>[]

optionaltimezone

timezone?: string

optionaltsNode

tsNode?: boolean

optionaltype

type?: mongo | mysql | mariadb | postgresql | sqlite | better-sqlite

optionaluseBatchInserts

useBatchInserts?: boolean

optionaluseBatchUpdates

useBatchUpdates?: boolean

optionaluser

user?: string

validate

validate: boolean

validateRequired

validateRequired: boolean