Open GmavionR opened 2 days ago
@GmavionR can you point me to the Next.js learning demo you are using? @vercel/postgres is a wrapper around the Neon serverless driver. I believe it is solely intended for use with Neon. I would not expect it to support connecting to a Supabase database.
Steps to reproduce
Start by creating a supabase pg storage in vercel, note supabase instead of neon. Then use the following code to test, will report an error.
The reason for the error is that we passed supabse's database url when using neon, which caused the query to error.
Why do you ask? Chapter 6 of the nextjs Learning demo mentions creating a database, but does not specify whether you should create neon or supabse. Although in theory @vercel/postgres blocks the difference between low-level neon and virtual.
However, there is a bug with @vercel/postgres that actually uses neon internally when sql is used directly in the following code, even though my.env configuration is configured with the supabase url
Expected result
neon gives the correct indication when linking to the supabse.com url
Actual result
Now it's an error
Environment
Logs, links