Skip to content

@vercel/postgres is not compatible with supabse and neon when connecting urls using sql apis #797

Open
@GmavionR

Description

@GmavionR

@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

neondatabase/serverless#122

Activity

rogeriomoura

rogeriomoura commented on Dec 2, 2024

@rogeriomoura

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

geekysaurabh001

geekysaurabh001 commented on Jan 1, 2025

@geekysaurabh001

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

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`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      @vercel/postgres is not compatible with supabse and neon when connecting urls using sql apis · Issue #797 · vercel/storage