Hi,
I’m new to fly.io.
I’ve followed the tutorial to deploy a small Rails app with the default configuration and everything works smoothly.
I’ve started adding data to the database through the forms of the app but I can’t seem to understand where the data is actually stored and if there’s a way to access it from outside the app.
Any help would be much appreciated.
The rails tutorial creates a Postgres database for you. You can run fly pg list to see your database, and you can log into it with fly pg connect -a <database-app-name>. You can read more about Postgres in our docs here.
Thank you for your help.
My initial launch did create a Postgres db but my app was by default configured to use sqlite3 and as a result the pg database is not in use by the app.
I guess I should switch locally to pg setting up the fly pg database as the production db in my database.yml file and deploy again, is that right ?
Thank you very much !
I’ve just switched my local app to pg and I’m indeed getting the following
printenv DATABASE_URL
postgres://
How should I configure my local app to connect to it?
Hi @pszmidt! Unfortunately the DATABASE_URL string contains the credentials to access your database, so it would be wise to change it before you put any data into it!