Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp: Replace Neon with Vercel Postgres #4580

Draft
wants to merge 12 commits into
base: dev
Choose a base branch
from
12 changes: 6 additions & 6 deletions driver-adapters-wasm/neon-cf-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"devDependencies": {
"@jest/globals": "29.7.0",
"jest": "28.1.3",
"prisma": "5.11.0-dev.8",
"wrangler": "3.28.3",
"node-fetch": "2.7.0"
"node-fetch": "2.7.0",
"prisma": "5.11.0-dev.6",
"wrangler": "3.28.3"
},
"dependencies": {
"@neondatabase/serverless": "0.8.1",
"@prisma/adapter-neon": "5.11.0-dev.8",
"@prisma/client": "5.11.0-dev.8"
"@prisma/adapter-neon": "5.11.0-integration-chore-adapter-neon-remove-pool-check.1",
"@prisma/client": "5.11.0-dev.6",
"@vercel/postgres": "^0.7.2"
}
}
116 changes: 75 additions & 41 deletions driver-adapters-wasm/neon-cf-basic/pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions driver-adapters-wasm/neon-cf-basic/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @ts-check
import { Prisma, PrismaClient } from '@prisma/client'
import { Pool } from '@neondatabase/serverless'
import { createPool } from '@vercel/postgres'
import { PrismaNeon } from '@prisma/adapter-neon'

export default {
async fetch(request, env, ctx) {
const client = new Pool({ connectionString: env.DRIVER_ADAPTERS_NEON_CF_BASIC_DATABASE_URL })
const client = createPool({ connectionString: env.DRIVER_ADAPTERS_NEON_CF_BASIC_DATABASE_URL.replace('.us-east-2', '-pooler.us-east-2') })
const adapter = new PrismaNeon(client)
const prisma = new PrismaClient({ adapter })

Expand Down
8 changes: 3 additions & 5 deletions driver-adapters/neon-lambda-basic/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// @ts-check
const { Prisma, PrismaClient } = require('@prisma/client')
const { WebSocket } = require('undici')
const { Pool, neonConfig } = require('@neondatabase/serverless')
const { createPool } = require('@vercel/postgres')
const { PrismaNeon } = require('@prisma/adapter-neon')

neonConfig.webSocketConstructor = WebSocket
const connectionString = process.env.DRIVER_ADAPTERS_NEON_LAMBDA_BASIC_DATABASE_URL?.replace('.us-east-2', '-pooler.us-east-2')

const connectionString = process.env.DRIVER_ADAPTERS_NEON_LAMBDA_BASIC_DATABASE_URL

const pool = new Pool({ connectionString })
const pool = createPool({ connectionString })
const adapter = new PrismaNeon(pool)
const prisma = new PrismaClient({ adapter })

Expand Down
6 changes: 3 additions & 3 deletions driver-adapters/neon-lambda-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"prisma": "5.11.0-dev.8"
},
"dependencies": {
"@neondatabase/serverless": "0.8.1",
"@prisma/adapter-neon": "5.11.0-dev.8",
"@prisma/client": "5.11.0-dev.8",
"@prisma/adapter-neon": "5.11.0-integration-chore-adapter-neon-remove-pool-check.1",
"@prisma/client": "5.11.0-dev.6",
"@vercel/postgres": "^0.7.2",
"undici": "6.6.2"
}
}
Loading
Loading