Trying to get this vercel integration to work with nextjs and prisma. Prisma studio says there is a table named Task with one row. Vercel browse tab shows the same. But the Vercel query tab errors out in the same way nextjs does. See pictures.
Current: [ Server ] Error: relation “task” does not exist
Expected: Data is returned
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}
model Task {
id Int @id @default(autoincrement())
user_id String
name String
description String
completed Boolean
created_at DateTime @default(now())
finished_at DateTime?
severity Severity?
kind Kind?
}
enum Severity {
LOW
MEDIUM
HIGH
}
enum Kind {
FEATURE
BUG
TASK
}
Hey there, is your local dev environment configured to use the same database as prod? My first thought is that maybe you forgot to run the production migration - is this possible? (kidding, I know it’s possible because I’ve done it )
Try connecting directly with psql from the command line - the fewer layers between you and the actual database, the more you can trust the results. Here’s the Neon docs on how to do this: Connect with psql - Neon Docs
If you confirm that the migration did take place and both of these are indeed pointing at the same database where you know Tasks is present, my next thought would be some issue between the Vercel and Neon infrastructure. Let me know if that’s the case and I can share with the appropriate team internally.
Solved. Apparently, In PostgreSQL, unquoted identifiers (such as table names) are automatically converted to lowercase. However, if you use double quotes around a table or column name, PostgreSQL treats it as case-sensitive and preserves the exact case. So when I query with `select * from “Task”; I get the data i’m looking for.
Maybe I can use @@map("task") // Ensures the table name is lowercase in my schema.