Studio is not working with multifile schemas
I have created a folder
schema
and added the following code to the schema.prisma
file
I can read from and write to the database, but when I run Prisma Studio, I get the following error:
The table main.User
does not exist in the current database.Solution:Jump to solution
GitHub
bug: sqlite is not working correctly with
prismaSchemaFolder
· Is...I encountered an issue when using the prismaSchemaFolder preview feature with a SQLite database. The problem occurs when running prisma db push. The database file is generated in the prisma/schema/...
12 Replies
Hello @sid 👋
What is your prisma version?
I just tried using Prisma studio with
prismaSchemaFolder
in a sqlite database and it worked as expected for me.
This was my schema file
And this was my user.prisma file
When I ran
npx prisma studio
The user model opened as expectedHi!
I have 6.0.1 prisma and client.
I tried it on 6.0.1 and it still works
Did you run
npx prisma db push
or npx prisma migrate dev
?I tried setting:
and it works fine. Thanks!
However, when I use
DATABASE_URL="file:../dev.db"
I get the following error.
Is this a bug or intended behavior?No, it should work as expected. The change you did just changes the location of db file.
I tried changing the location of db in schema file like this:
And it worked as expected (see the new dev.db created outside prisma folder)
I am still getting this error with the parent directory.
Is there anything I can provide to help figure out the cause? Or do I need to clear some Prisma cache or something like that?
Could you try running
npx prisma db push
before running npx prisma studio
and check if you still get the same error?hey, I had same problem, use this workaround to be able to work with prisma studio https://github.com/prisma/prisma/issues/25084#issuecomment-2553182814
GitHub
bug: sqlite is not working correctly with
prismaSchemaFolder
· Is...I encountered an issue when using the prismaSchemaFolder preview feature with a SQLite database. The problem occurs when running prisma db push. The database file is generated in the prisma/schema/...
Thank you! That’s exactly the same bug.
Thank you for sharing the link to the Issue and workaround
I believe this issue will be resolved when prismaSchemaFolder will go from preview to GA.
Solution
GitHub
bug: sqlite is not working correctly with
prismaSchemaFolder
· Is...I encountered an issue when using the prismaSchemaFolder preview feature with a SQLite database. The problem occurs when running prisma db push. The database file is generated in the prisma/schema/...