I am getting this error message from prisma when I am running the GraphQL query.
Environment variable not found: DATABASE_URL.\n --> schema.prisma:6\n | \n 5 | provider = \"postgresql\"\n 6 | url = env(\"DATABASE_URL\")\n | \n\nValidation Error Count: 1",
At first, I didn't have the .env file in any of my project folders, then I added it with the link to the database url, still not working. Here is the folder structure:
This is what I have inside my .env
file looks like -
DATABASE_URL="postgres://postgres:mypassword@db.pqtgawtgpfhpqxpgidrn.supabase.co:5432/postgres"
If anybody running into this issue, just run npx prisma generate
. This will re-establish the link between schema.prisma and .env file.