Files
TREK/server/src/nest/database/orm.module.ts
T
Maurice 724c88c201 style: format server and shared with prettier
A mechanical prettier --write over server/src, server/tests, server/scripts
and shared/src with the workspaces' .prettierrc; nothing but layout and
import order changes, and every file keeps the same set of imports. shared
is formatted throughout and its format baseline is empty. The server
baseline keeps the 35 files that Prettier would grow past their lint:size
limit (they need a split first, which is not a formatting change), and the
generated entity files stay as their generator writes them.
2026-10-10 21:23:37 +02:00

20 lines
890 B
TypeScript

import { UnitOfWork } from './unit-of-work';
import { Global, Module } from '@nestjs/common';
/**
* The ORM-side container module: the home of providers that depend on MikroORM
* itself rather than on the raw better-sqlite3 handle `DatabaseModule` owns.
*
* Deliberately separate from `DatabaseModule`, which the e2e suites that
* compose `DatabaseModule` without the ORM build standalone
* (`Test.createTestingModule({ imports: [DatabaseModule, ...] })`)
* with no ORM in the container: a provider there that injects the core
* `EntityManager` fails every one of them at `compile()`, because Nest
* instantiates providers eagerly. Nothing is imported here — the
* `EntityManager` token comes from `MikroOrmModule.forRoot`, whose
* `MikroOrmCoreModule` is itself `@Global()`.
*/
@Global()
@Module({ providers: [UnitOfWork], exports: [UnitOfWork] })
export class OrmModule {}