prisma-adapter-postgres
v1.0.2
Published
Prisma's driver adapter for Porsager 'postgres' library
Readme
prisma-adapter-postgres
Prisma driver adapter for postgres.
Install
You will need to install the prisma-adapter-postgres driver adapter and the postgres client.
npm install prisma-adapter-postgres postgrespnpm add prisma-adapter-postgres postgresbun add prisma-adapter-postgres postgresSetup
import postgres from "postgres";
import { PrismaPostgres } from "prisma-adapter-postgres";
import { PrismaClient } from "@prisma/client";
// init postgres client
const sql = postgres(process.env.DATABASE_URL!);
// init prisma with the adapter
const adapter = new PrismaPostgres(sql);
const prisma = new PrismaClient({ adapter });
const user = await prisma.user.create({
data: {
email: "[email protected]",
name: "test"
}
});Credits
Based on other projects:
