I’ve built a webapp with the RemixJS Indies stack. I’m having a hard time finding out how to interact with my deployed database. I’ve made some very big changes in the db, and i’ve just overwritten the dev database completely. I am at a stage now, where i would also just like to overwrite my prod database, as this is just a prototype with no real data. But i’d also love to know in the future, how i might actually update the database.
I’ve tried several things listed in the Prisma docs, especially from here:
Normally, my database url looks like this:
DATABASE_URL=“file:./data.db?connection_limit=1”
And i’ve also tried to change that to
DATABASE_URL=“file:./data/sqlite.db”
The db still works, but it’s still the db database.
I love the graphical user interface that npx prisma studio provides, but can i get the same thing for my prod database? I feel like i have no insight into how it looks, other than SSL’ing directly in and
writing sql queries in my terminal and getting some information out.
I’m and experienced front-end developer, but i really suck at database stuff, so bear with me…
The good news is that running prisma studio is easy. The bad news is that accessing it securely requires a few steps. I’ll just provide a sketch, and if you are interested and have further questions, follow up.
You are going to want to run both your server and prisma studio, so I would recommend looking into concurrently - npm . Get to the point where “yarn start” runs both automatically. If at this point you try to deploy to fly.io, it will probably fail as one or more of the modules that you need to run prisma studio are likely listed as devDependencies. Move those to depenencies and try again.
Next, you are going to need access. Normally when you run locally you would access prisma studio with something like http://localhost:5555/. To do the same with fly.io, you would add the following to your fly.toml and redeploy:
I say that, but you probably don’t want to do that. Prisma studio doesn’t have any authentication, so this will allow the whole internet direct access to your database. So instead of doing that, you will want to VPN into our network. Instructions on doing that can be found here: Private Networking · Fly Docs