• Closes an instance.

    Closes an instance, and inherently prevents further calls of useOrm or useEntityManager with that name. After the returned promise settles, initOrm may be called again with the same name.

    This function is effectively a no-op if the instance is already closed.

    Parameters

    • name: string = 'default'

      The name of the instance to be closed.

    • Optional force: boolean

      Whether to force the connection to be closed.

    Returns Promise<void>

    A promise that resolves once the MikroORM instance is closed, and the name is unregistered.