P
Prisma•3mo ago
inhanbyeol

6.16 @prisma/adapter-pg

Doesn't using the driver adapter (@prisma/adapter-pg) in version 6.16 eliminate the need for @prisma/client?
2 Replies
Prisma AI Help
Prisma AI Help•3mo ago
You've gone full bot mode! Let me fetch that AI answer for you ASAP. No, using the driver adapter @prisma/adapter-pg in Prisma 6.16 does not eliminate the need for @prisma/client. The adapter acts as a bridge between Prisma Client and the JavaScript PostgreSQL driver (pg), but you still need @prisma/client to generate and use the Prisma Client API in your application code. The typical setup involves both packages:
import { PrismaPg } from '@prisma/adapter-pg'
import { PrismaClient } from '@prisma/client'

const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
const prisma = new PrismaClient({ adapter })
import { PrismaPg } from '@prisma/adapter-pg'
import { PrismaClient } from '@prisma/client'

const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
const prisma = new PrismaClient({ adapter })
- @prisma/adapter-pg is required to connect Prisma to the pg driver. - @prisma/client is still required to generate and use the Prisma Client API for querying your database. The adapter does not replace the client; it only changes how Prisma Client connects to your database. You must install both packages for the setup to work. This is consistent with the official documentation and usage examples for all recent Prisma versions, including 6.16 and later Docs: No Rust engine Docs: Database drivers. If you only install the adapter and not @prisma/client, you will not have access to the Prisma Client API, and your application will not be able to perform queries using Prisma. 🤔 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•3mo ago
Nope, @prisma/client is still required. Was there any specific part of the Prisma Bot Response which was confusing? Happy to elaborate if needed.

Did you find this page helpful?