Nicolas Chusseau
Nicolas Chusseau

Reputation: 81

Error: P1001: Can't reach database server using prisma, supabase and redwood

I want to do a migration using prisma, supabase and redwood.

The problem is that when I try to do yarn redwood prisma migrate dev I get this : error message

My schema.prisma :

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider      = "prisma-client-js"
  binaryTargets = "native"
}

model profiles {
  id         String   @id @default(uuid())
  updatedat  DateTime?
  firstName  String?
  lastName   String?
  email      String @unique
}

I have in my .env the DATABASE_URL found on supabase -> project settings -> database. The value looks like this : postgresql://postgres:[email protected]:5432/postgres

It actually works when I try my application on my localhost with yarn redwood dev command. I can read and write my profile table.

Upvotes: 0

Views: 1142

Answers (1)

bupt dlmu
bupt dlmu

Reputation: 1

I have the same problem just now. The "Error: P1001" disappeared after I used Telnet to connect to the db.

Try:

telnet db.oteaeccdiheyyajfvmqb.supabase.co 5432

Upvotes: 0

Related Questions