MikroORM <EM>
Hierarchy
- MikroORM<PostgreSqlDriver, EM>
- MikroORM
Index
Constructors
constructor
Parameters
options: Options<PostgreSqlDriver, EM> | Configuration<PostgreSqlDriver, EM>
Returns PostgreSqlMikroORM<EM>
Properties
readonlyinheritedconfig
inheritedem
The global EntityManager instance. If you are using RequestContext
helper, it will automatically pick the request specific context under the hood
Accessors
inheritedentityGenerator
Shortcut for
orm.getEntityGenerator()
Returns IEntityGenerator
inheritedmigrator
Shortcut for
orm.getMigrator()
Returns IMigrator
inheritedschema
Shortcut for
orm.getSchemaGenerator()
Returns ReturnType<ReturnType<D[getPlatform]>[getSchemaGenerator]>
inheritedseeder
Shortcut for
orm.getSeeder()
Returns ISeedManager
Methods
inheritedcheckConnection
Checks whether the database connection is active, returns .
Returns Promise<{ ok: true } | { error?: Error; ok: false; reason: string }>
inheritedclose
Closes the database connection.
Parameters
force: boolean = false
Returns Promise<void>
inheritedconnect
Connects to the database.
Returns Promise<PostgreSqlDriver>
inheriteddiscoverEntities
Returns Promise<void>
inheriteddiscoverEntitiesSync
Returns void
inheriteddiscoverEntity
Allows dynamically discovering new entity by reference, handy for testing schema diffing.
Parameters
entities: T | T[]
optionalreset: string | string[]
Returns void
inheritedgetEntityGenerator
Gets the EntityGenerator.
Returns T
inheritedgetMetadata
Gets the
MetadataStorage
.Returns MetadataStorage
inheritedgetMigrator
Gets the Migrator.
Returns T
inheritedgetSchemaGenerator
Gets the SchemaGenerator.
Returns SqlSchemaGenerator
inheritedgetSeeder
Gets the SeedManager
Returns T
inheritedisConnected
Checks whether the database connection is active.
Returns Promise<boolean>
inheritedreconnect
Reconnects, possibly to a different database.
Parameters
options: Options = {}
Returns Promise<void>
staticinit
staticinitSync
Synchronous variant of the
init
method with some limitations:- database connection will be established when you first interact with the database (or you can use
orm.connect()
explicitly) - no loading of the
config
file,options
parameter is mandatory - no support for folder based discovery
- no check for mismatched package versions
Parameters
options: Options<D, EM>
Returns MikroORM<D, EM>
- database connection will be established when you first interact with the database (or you can use
Helper class for bootstrapping the MikroORM.