@vercel/postgres is not compatible with supabse and neon when connecting urls using sql apis
@vercel/postgres is not compatible with supabse and neon when connecting urls using sql apis
If the database is supabse, but the underlying link uses neon directly
https://github.com/neondatabase/serverless/issues/122
I think I ran into the same issue when trying to follow the Nextjs tutorial, chapter 7. I had setup a supabase on chapter 6 on Vercel, but when trying to use the sql imported from @vercel/postgres it wasn't working, I had to use db and initiate a client.
Next's tutorial for reference: https://nextjs.org/learn/dashboard-app/fetching-data
I think I ran into the same issue when trying to follow the Nextjs tutorial, chapter 7. I had setup a supabase on chapter 6 on Vercel, but when trying to use the
sqlimported from @vercel/postgres it wasn't working, I had to usedband initiate a client.Next's tutorial for reference: https://nextjs.org/learn/dashboard-app/fetching-data
This worked for Chapter 7.
In data.ts file:
import { db } from "@vercel/postgres";
const client = await db.connect();
And then in the same file, replace sql with client.sql everywhere.
Example:
const data = await client.sql<Revenue>`SELECT * FROM revenue`;