Skip to content

Commit

Permalink
Replace Neon Serverless Driver with @vercel/postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
janpio committed Feb 23, 2024
1 parent 5fe5a67 commit fe8c315
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/bundle-size/da-workers-neon/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Pool } from '@neondatabase/serverless'
import { PrismaNeon } from '@prisma/adapter-neon'
import { createPool } from '@vercel/postgres'

import { PrismaClient } from './client/wasm'

export default {
async fetch(request, env) {
const neon = new Pool({ connectionString: env.DATABASE_URL })
const adapter = new PrismaNeon(neon)
const pool = createPool({ connectionString: env.DATABASE_URL })
const adapter = new PrismaNeon(pool)
const prisma = new PrismaClient({ adapter })

const users = await prisma.user.findMany()
Expand Down
6 changes: 3 additions & 3 deletions packages/bundle-size/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"license": "Apache-2.0",
"dependencies": {
"@libsql/client": "0.4.3",
"@neondatabase/serverless": "0.8.1",
"@planetscale/database": "1.16.0",
"@prisma/adapter-d1": "workspace:*",
"@prisma/adapter-libsql": "workspace:*",
"@prisma/adapter-neon": "workspace:*",
"@prisma/adapter-pg": "workspace:*",
"@prisma/adapter-planetscale": "workspace:*",
"@prisma/adapter-libsql": "workspace:*",
"@prisma/adapter-d1": "workspace:*",
"@prisma/client": "workspace:*",
"@vercel/postgres": "^0.7.2",
"pg": "8.11.3",
"prisma": "workspace:*",
"wrangler": "3.28.2"
Expand Down
50 changes: 40 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fe8c315

Please sign in to comment.