Two different connections
cursan-a opened this issue · 2 comments
cursan-a commented
Hi,
On my project I need to open 2 postgresql connections (1 master, 1 read replica for analytics). I can't figure how to give a custom name when I instantiate a PrismaModule
that allow me to inject PrismaService
with the specified name.
I need something like :
whatever.module.ts
@Module({
imports: [
PrismaModule.forRootAsync({
name: 'ANALYTICS_DATABASE'
...
whatever.service.js
@Injectable()
export class WhateverService {
@Inject("ANALYTICS_DATABASE")
private readonly prismaAnalytics!: PrismaService;
...
Is that possible with your implementation ?
Thank you in advance
marcjulian commented
marcjulian commented
Closing this for now as it has the same solution as #31.