PrismaP
Prisma7mo ago
2 replies
roguehusky3

Where to find PrismaClientKnownRequestError with the new generated client

I cannot find the right place to import PrismaClientKnownRequestError from with the new version. This is my schema:
datasource db {
  provider = "sqlite"
  url      = env("PRISMA_DATABASE_URL")
}

generator client {
  provider = "prisma-client"
  output   = "../src/generated/prisma"

  previewFeatures = ["driverAdapters", "queryCompiler"]
}

model User {
  id    String @id @default(uuid())
  name  String
  email String @unique
}

- import { Prisma } from "@prisma/client"; does not exist
- The generated client does not expose the type in a public way
- The only place I can get it from is import { PrismaClientKnownRequestError } from "~/generated/prisma/internal/prismaNamespace"; which seems to be wrong, it is depending on internals

How do I do this?
Was this page helpful?