Sabin Adams
Sabin Adams
Explore posts from servers
PPrisma
Created by Sabin Adams on 9/18/2024 in #help-and-questions
Schema Visualizer
Has there been any thoughts about a schema visualizer in your PDP account? Something similar to Prismalizer but built right into your control plane? I'd love a feature like that, especially if it would automatically consolidate split schemas. (ignore the off-topic tags, there wasn't a relevant option)
3 replies
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