mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 04:20:55 +00:00
19 lines
806 B
TypeScript
19 lines
806 B
TypeScript
import { registerAs } from '@nestjs/config';
|
|
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
|
import { buildIamTypeOrmOptions } from '../common/iam-typeorm.config';
|
|
|
|
/**
|
|
* Dedicated config namespace for the IAM **TypeORM** connection — the shared `iam` schema ONLY.
|
|
*
|
|
* This is intentionally separate from Prisma: Prisma remains the app's primary ORM and owns the
|
|
* `passenger` schema via `DATABASE_URL` (see prisma.service.ts). This second connection exists
|
|
* solely because `@tria-plc/api-common` / `@tria-plc/iamapi-common` are TypeORM-based and the
|
|
* `JwtGuard` reads `iam.sessions` through a TypeORM `DataSource`.
|
|
*
|
|
* Consumed by `TypeOrmModule.forRootAsync` in app.module.ts.
|
|
*/
|
|
export default registerAs(
|
|
'iamDatabase',
|
|
(): TypeOrmModuleOptions => buildIamTypeOrmOptions(),
|
|
);
|