Skip to main content
Version: 5.2

MikroORM <D>

Helper class for bootstrapping the MikroORM.

Index

Constructors

constructor

Properties

readonlyconfig

config: Configuration<D>

em

The global EntityManager instance. If you are using RequestContext helper, it will automatically pick the request specific context under the hood

Methods

close

  • close(force?: boolean): Promise<void>
  • Closes the database connection.


    Parameters

    • force: boolean = false

    Returns Promise<void>

connect

  • connect(): Promise<D>
  • Connects to the database.


    Returns Promise<D>

discoverEntities

  • discoverEntities(): Promise<void>
  • Returns Promise<void>

discoverEntity

  • Allows dynamically discovering new entity by reference, handy for testing schema diffing.


    Type parameters

    • T

    Parameters

    Returns Promise<void>

getEntityGenerator

  • getEntityGenerator<T>(): T

getMetadata

getMigrator

  • getMigrator<T>(): T

getSchemaGenerator

  • getSchemaGenerator(): ReturnType<ReturnType<D[getPlatform]>[getSchemaGenerator]>
  • Gets the SchemaGenerator.


    Returns ReturnType<ReturnType<D[getPlatform]>[getSchemaGenerator]>

getSeeder

  • getSeeder<T>(): T

isConnected

  • isConnected(): Promise<boolean>
  • Checks whether the database connection is active.


    Returns Promise<boolean>

staticinit