albingroen / prismabuilder.io

Build your Prisma schema visually in this easy-to-use web based tool
https://www.prismabuilder.io
278 stars 30 forks source link

Importation bug #72

Closed TomPere02 closed 1 year ago

TomPere02 commented 1 year ago

Hello,

When I import this schema it gives me this error "Make sure to import a full schema" :

`datasource db { provider = "mysql" url = env("DATABASE_URL") relationMode = "prisma" }

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

model users { id Int @id @default(autoincrement()) email String @db.VarChar(255) name String? @db.VarChar(255) username String? @db.VarChar(255) } `

markanator commented 1 year ago

I only import my models, and that doesn't cause any issues.

TomPere02 commented 1 year ago

I only import my models, and that doesn't cause any issues.

Even if I import just the model, it gives me the same error.

model users { id Int @id @default(autoincrement()) email String @db.VarChar(255) name String? @db.VarChar(255) username String? @db.VarChar(255) }

albingroen commented 1 year ago

I looked into this a little. I'm relying on Pal.js for the schema importing, and it seems like you both need to add the datasource and generator parts, as well as a minimum of 2 models for it to work