Using Neon on top of Vercel

I just integrated Neon on Vercel, expecting to see better integration on the web app.

However, it just left me with trouble when I have 676 users and I have to use backup.

When I restored my db, Vercel cut the access to the new database, and I was not even able to reconnect to existing database created by Vercel.
What’s worse, all of new deployment on neon are suspended. I cannot have my db connect whatever I do in neon, and I cannot even transfer my existing data to the new neon project.

The only way to get new database is to delete all the existing data I have and start new one from Vercel. This is so retarded. Is there anyway I can just connect neon db on Vercel without limiting from this?

Why does the credentials change when I just changed my branch for database? I just need to connect my database, and Vercel is blocking this and users are being frustrated.

I just want to write in this database again and this is so frustrating.

prisma:error
Invalid `prisma.user.findUnique()` invocation:

Authentication failed against database server, the provided database credentials for `(not available)` are not valid.

Please make sure to provide valid database credentials for the database server at the configured address.

[check-username] Error: Error [PrismaClientInitializationError]:
Invalid `prisma.user.findUnique()` invocation:

Authentication failed against database server, the provided database credentials for `(not available)` are not valid.

Please make sure to provide valid database credentials for the database server at the configured address.
at async y (.next/server/app/api/(site)/auth/check-username/route.js:1:1281)
at async k (.next/server/app/api/(site)/auth/check-username/route.js:1:4377)
at async g (.next/server/app/api/(site)/auth/check-username/route.js:1:5380) {
clientVersion: ‘6.19.1’,
errorCode: undefined,
retryable: undefined
}

Why do I get credentials error when I have credentials given by Vercel? I just don’t fucking understand.

(sorry for the slow response, just coming back after the holidays)

The Neon integration for Vercel does two things

  • creates a managed “Vercel Team” workspace in your Neon account, with billing managed through Vercel
  • automatically applies your environment variables to attached projects

Since the environment variables are the only real link between Neon and your project, you can change them at any time by setting them manually

You can switch between the managed Vercel workspace and your personal here

You can find the connection string for your Neon DB here and use that as the DATABASE_URL environment variable

Why does the credentials change when I just changed my branch for database?

This is how Neon works, not related to Vercel’s integration

  • the data and branches are basically static storage
  • each DB can have a “compute” which is the running Postgres instance with its own credentials. This is pinned to a branch
  • you can reset the data for a branch to its parent or restore from another branch, but you don’t change from one branch to another without changing credentials

Here are the Neon docs on computes

And they have some workflow docs for how to think about branching here

1 Like