What is the proper way to connect neon with drizzle orm in next js?
I'm working on an next js application deployed to vercel with drizzle orm - neon postgres
Following the drizzle orm docs I've setup my db as below
but i get the following warning during generating migrations: Warning '@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket
https://neon.tech/docs/guides/drizzle#use-the-neon-serverless-driver-with-drizzle
In neon docs
Or from neon - connect to your db modal
I will primarily use this connection from server components / api routes for CRUD & transactions, What's the proper setup for this case?
Neon
Connect from Drizzle to Neon - Neon Docs
How to connect from Drizzle How to use the Neon serverless driver with Drizzle Drizzle with Neon Postgres (Drizzle Docs) Schema migration with Drizzle ORM Next.js Edge Functions with Drizzle Drizzle i...
1 Reply
flat-fuchsia•7mo ago
Hi @Rishi Kasyap,
Here's how you'd want to do use the Drizzle with Next.js for API routes - https://github.com/neondatabase/examples/tree/main/with-nextjs-drizzle-edge.