P
Prisma•2mo ago
inhanbyeol

no rust prisma client

When creating and using a Prisma client by combining PG adapters, is it necessary to install @prisma/client? If I continue using it the way I have been, there will be no more sources to use. If possible, can you also handle the migration and seeding tasks?
2 Replies
Prisma AI Help
Prisma AI Help•2mo ago
You opted for speed from this bot. Let's conjure up an answer right now! When using the Rust-free Prisma ORM (with engineType = "client" and a PG adapter), you do not need to install the @prisma/client package. Instead, you generate the client using the new "prisma-client" generator, and import it from your specified output directory. The @prisma/client package is only required for the traditional Rust-engine-based setup. With the new architecture, you install the appropriate driver adapter (e.g., @prisma/adapter-pg for PostgreSQL) and use the generated client directly [source]. Example setup: 1. In your schema.prisma:
generator client {
provider = "prisma-client"
output = "../generated/prisma"
engineType = "client"
}

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

2. Generate the client:
npx prisma generate

npx prisma generate

3. Install the PG adapter:
npm install @prisma/adapter-pg

npm install @prisma/adapter-pg

4. Use the client in your code:
import { PrismaClient } from '../generated/prisma';
import { PrismaPg } from '@prisma/adapter-pg';

const adapter = new PrismaPg(/* ... */);
const prisma = new PrismaClient({ adapter });

import { PrismaClient } from '../generated/prisma';
import { PrismaPg } from '@prisma/adapter-pg';

const adapter = new PrismaPg(/* ... */);
const prisma = new PrismaClient({ adapter });

Migrations and Seeding:
You can continue to use the Prisma CLI (prisma migrate, prisma db seed) as before. The migration and seeding workflows are unchanged; you do not need @prisma/client for these tasks, but you do need the prisma CLI installed as a dev dependency [source]. Summary:
- Do not install @prisma/client with the Rust-free setup. - Use the generated client from your output directory. - Continue using the Prisma CLI for migrations and seeding. If you need more details, see the official docs for the Rust-free setup. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Nurul
Nurul•2mo ago
The bot response was incorrect btw, you still need to install @prisma/client. https://www.npmjs.com/package/@prisma/client

Did you find this page helpful?