Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

maxk096/nestjs-prisma-broken-v3

Repository files navigation

Basics

NestJS app with Express, Prisma and nestjs-prisma.

npm i

npm run start:dev

Adjust prisma/schema.prisma and perform a migration:

npx prisma migrate dev

Use PrismaService to access the type-safe generated PrismaClient.

import { Injectable } from '@nestjs/common';
import { PrismaService } from 'nestjs-prisma';

@Injectable()
export class AppService {
  constructor(private prisma: PrismaService) {}

  users() {
    return this.prisma.user.findMany();
  }

  user(userId: string) {
    return this.prisma.user.findUnique({
      where: { id: userId },
    });
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published