PlutoUranus
PlutoUranus
PPrisma
Created by PlutoUranus on 12/10/2024 in #help-and-questions
Error at adding Prisma 6.0.1 to NextJs 15: can-connect-to-database
I was trying to add Prisma to an existing NextJs 15 project: According to Prisma doc https://www.prisma.io/docs/getting-started/quickstart-sqlite
pnpm dlx prisma init --datasource-provider sqlite
pnpm dlx prisma init --datasource-provider sqlite
I added my own Snippet model into ./prisma/schema.prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

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

model Snippet {
id Int @id @default(autoincrement())
title String
code String
}
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

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

model Snippet {
id Int @id @default(autoincrement())
title String
code String
}
Then I ran Prisma migration command:
pnpm dlx prisma migrate dev
pnpm dlx prisma migrate dev
Then in my terminal I got:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "dev.db" at "file:./dev.db"

Error: Schema engine exited. Error: Command failed with exit code 1:
/home/user1234/.cache/pnpm/dlx/b4kwuke4fcm2ppufregi7l7yfi/193ad3f76d0-19fd8/
node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines/
schema-engine-debian-openssl-3.0.x cli --datasource <REDACTED> can-connect-to-database
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "dev.db" at "file:./dev.db"

Error: Schema engine exited. Error: Command failed with exit code 1:
/home/user1234/.cache/pnpm/dlx/b4kwuke4fcm2ppufregi7l7yfi/193ad3f76d0-19fd8/
node_modules/.pnpm/@[email protected]/node_modules/@prisma/engines/
schema-engine-debian-openssl-3.0.x cli --datasource <REDACTED> can-connect-to-database
and no new SQL migration file was generated for the migration in the prisma/migrations
5 replies