fix: problee m met mergen en zorgen student Gerald in db komt bij npm run dev runnen
This commit is contained in:
parent
1ffd77cce7
commit
8218aae6ec
10 changed files with 372 additions and 62 deletions
|
@ -1,10 +1,10 @@
|
|||
import { EntityManager, MikroORM } from '@mikro-orm/core';
|
||||
import { Connection, EntityManager, IDatabaseDriver, MikroORM } from '@mikro-orm/core';
|
||||
import config from './mikro-orm.config.js';
|
||||
import { envVars, getEnvVar } from './util/envVars.js';
|
||||
import { getLogger, Logger } from './logging/initalize.js';
|
||||
|
||||
let orm: MikroORM | undefined;
|
||||
export async function initORM(testingMode = false): Promise<void> {
|
||||
export async function initORM(testingMode = false): Promise<MikroORM<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>> {
|
||||
const logger: Logger = getLogger();
|
||||
|
||||
logger.info('Initializing ORM');
|
||||
|
@ -25,6 +25,8 @@ export async function initORM(testingMode = false): Promise<void> {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
return orm;
|
||||
}
|
||||
export function forkEntityManager(): EntityManager {
|
||||
if (!orm) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue