π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
constructor() {
super({
log: [
{
emit: 'event',
level: 'query',
},
],
});
}
async onModuleInit() {
await this.$connect();
}
async onModuleDestroy() {
await this.$disconnect();
}
}
@Injectable()
export class PrismaRepository<T extends keyof PrismaService> {
public model: Pick<PrismaService, T>;
constructor(private _prismaService: PrismaService) {
this.model = this._prismaService;
}
}
@Injectable()
export class PrismaTransaction {
public model: Pick<PrismaService, '$transaction'>;
constructor(private _prismaService: PrismaService) {
this.model = this._prismaService;
}
}