Shadow db with prisma

I'm trying to use Prisma with Planetscale, but Planetscale only has 1 db in the free tier and I need 2. Any recommendations for setting up a shadow db in tandem with Planetscale?
12 Replies
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
amanuel
amanuelOP•3y ago
Oh I see, is there any resource about this? What do I use as the shadow db url in Prisma? I'll try tonight after work
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
amanuel
amanuelOP•3y ago
Thank you so much
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
amanuel
amanuelOP•3y ago
Great, I'll take a look tonight I tried hacking this together last week and I remember that it was giving me some sort of error that led me to think I needed a shadow db I'll ping here when I open up the project again
adiguno
adiguno•3y ago
I've had the same problem (when following theo's roundest project)
adiguno
adiguno•3y ago
adiguno
adiguno•3y ago
"If you are developing against a cloud-based database (for example, on Heroku) and are currently prototyping such that you don't care about generated migration files and only need to apply your Prisma data model to the database schema, you can run prisma db push instead of the prisma migrate dev command." still not sure what is a good way to handle it though 🤷 since we only have 2 db main/dev, and shadow generates a third temporary one for dev
amanuel
amanuelOP•3y ago
@adiguno thank you so much! Were you able to complete the roundestmon?
adiguno
adiguno•3y ago
np, I wasn't building roundest so I'm not sure if there's other catches ahead
amanuel
amanuelOP•3y ago
I'm getting this error:
Error: P3014

Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases. Read more about the shadow database (and workarounds) at https://pris.ly/d/migrate-shadow

Original error:
create database is not supported
0: migration_core::state::DevDiagnostic
at migration-engine\core\src\state.rs:251
Error: P3014

Prisma Migrate could not create the shadow database. Please make sure the database user has permission to create databases. Read more about the shadow database (and workarounds) at https://pris.ly/d/migrate-shadow

Original error:
create database is not supported
0: migration_core::state::DevDiagnostic
at migration-engine\core\src\state.rs:251
I fixed it using the
npx prisma db push init
npx prisma db push init
command Thank you!
Want results from more Discord servers?
Add your server