File size: 983 Bytes
f78b36a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { Module, Global } from "@nestjs/common";
import { PrismaService } from "./prisma.service";

/**
 * Database Module (Prisma)
 *
 * ORM CHOICE: Prisma
 *
 * JUSTIFICATION:
 * - Type-safe database client with excellent TypeScript support
 * - Intuitive schema definition language
 * - Automatic migration generation
 * - Built-in connection pooling
 * - Great developer experience with Prisma Studio
 * - Strong PostgreSQL support
 *
 * CLINICAL SAFETY CONSIDERATIONS:
 * - All entities will enforce strict validation at schema level
 * - Type safety prevents invalid data operations
 * - Audit logging capabilities via middleware
 * - Transaction support for data integrity
 * - No raw SQL for sensitive operations (use Prisma queries)
 *
 * This module is marked as @Global so PrismaService is available
 * throughout the application without repeated imports
 */

@Global()
@Module({
  providers: [PrismaService],
  exports: [PrismaService],
})
export class DatabaseModule {}