@motech-development/prisma
v1.0.6
Published
NestJS module for Prisma
Downloads
71
Readme
@motech-development/prisma
NestJS module for Prisma
A NestJS module that allows you to interact with your database using Prisma.
Installation
Add @motech-development/prisma
as a dependency.
# Yarn
yarn add @motech-development/prisma
# NPM
npm i @motech-development/prisma
Usage
Add the PrismaModule
to your application.
import { PrismaModule } from '@motech-development/prisma';
@Module({
imports: [PrismaModule],
})
class AppModule {}
The module will then make the PrismaService
available to use.
import { PrismaService } from '@motech-development/prisma';
@Injectable()
class AppService {
constructor(private readonly prismaService: PrismaService) {}
public deleteUser(id: string): Promise<void> {
await this.prismaServiceuser.delete({
where: {
id,
},
});
}
}