@icapps/nestkit-prisma
v0.0.1
Published
Based on [`@prisma/client@^5.3.1`](https://www.npmjs.com/package/@prisma/client/v/5.3.1)
Downloads
5
Readme
@icapps/nestkit-prisma
Based on @prisma/client@^5.3.1
Installation
npm install @icapps/nestkit-prisma
Usage
1. Install Prisma CLI as a development dependency
npm install prisma --save-dev
2. Initialize Prisma into your project
npx prisma init
3. Import PrismaModule
into your root module
import { PrismaModule } from '@icapps/nestkit-prisma';
@Module({
imports: [
ConfigModule.forRoot({ load: [appConfig] }),
PrismaModule,
TodosModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
4. Inject PrismaService
into your service
...
import { PrismaService } from '@icapps/nestkit-prisma';
@Injectable()
export class TodosService {
constructor(private prisma: PrismaService) {}
create(data: CreateTodoDto): Promise<Todo> {
return this.prisma.todo.create({ data });
}
...
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.