mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 15:51:00 +00:00
724c88c201
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.
20 lines
890 B
TypeScript
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 {}
|