Sabin Adams
Sabin Adams
Explore posts from servers
PPrisma
Created by Sabin Adams on 8/14/2024 in #help-and-questions
Pulse Type
Is there a good way to get the type of a Prisma Client instance with Pulse before instantiating it? For context, I have a class that will eventually have a member populated with a Pulse DB instance:
@Module({})
export class VendorModule implements OnModuleInit {
private pulse: typeof pulseType;
constructor(@Inject('PRISMA') private prisma: PrismaClient) {}

async onModuleInit() {
this.pulse = this.prisma.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY,
}),
);
await this.setupListeners();
}

private async setupListeners() {
this.pulse.user.stream(/*...*/);
}
}
@Module({})
export class VendorModule implements OnModuleInit {
private pulse: typeof pulseType;
constructor(@Inject('PRISMA') private prisma: PrismaClient) {}

async onModuleInit() {
this.pulse = this.prisma.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY,
}),
);
await this.setupListeners();
}

private async setupListeners() {
this.pulse.user.stream(/*...*/);
}
}
16 replies
PPrisma
Created by Sabin Adams on 7/26/2024 in #help-and-questions
Log Transports
Is it possible to set up transports for Prisma Client logs? Context: I want to push logs to Grafana Loki using its HTTP endpoint. Here's an example of Pino logger doing it: https://www.npmjs.com/package/pino-loki If it's not possible directly, is this something Client Extensions could do?
4 replies
RRailway
Created by Sabin Adams on 6/15/2023 in #✋|help
Postgres Configurations
Is it possible to configure the following on a Postgres instance in Railway: - A user that has superuser access to the DB? - Logical Replication
21 replies