You should be able to run fly ssh console -C "sqlite3 /path/to/database.db" and get a sqlite3 shell. .schema will show you all the tables, you can read here for other commands: Command Line Shell For SQLite
If this is a Remix Indie stack project, you can run fly ssh console -C database-cli. If it’s a custom Docker Image, you can add this to your Dockerfile to create the same command:
Both commands work Awesomely and I can edit db with sql commands.
Is their any way if I can do the same operation using prisma studio which basically provides a UI to update the underlying DB. prisma studioruns https://localhost:5555 on remote and I have wireguard configured on local machine for remote fly server. Any way if I could connect both of them and manage db through my local machine using an UI?
local Url → wireguard middleware → remote machine localhost:5555 for managing the DB.
Hope it’s clear. Please let me know if any more is needed.
I was able to get Prisma studio on my deployed instance working locally! First, in one terminal tab I ran:
fly proxy 3001:5555
Then, in a separate tab, I ssh’d into my app:
fly ssh console
cd your-app-name
npx prisma studio
I didn’t see anything after that, so wasn’t sure it worked, but sure enough, I opened a browser to http://localhost:3001 and there was my prod data. Not too long after I got an email saying my instance had run out of memory and crashed . I guess prisma uses a lot.