In this article, I will tell you about an alternative method to view your database from the Heroku platform. Check the tables of your Heroku Postgres Database used by your website or an application.
When I deployed my application on Heroku, I was curious about checking tables created by Django and Models. But was unable to check it as Heroku provides no specific functionality to view what's inside a database. After exploring, I found this application that helped me go through my database tables.
Following are the quick steps to get started,
Download a small application
Firstly download the application file respective to your machine from this link and extract the zip file.
Run the application
Run this application and this will start one localhost session at
https://localhost:8081 or any other port.
After visiting the respective localhost link, you will see the following page. You will get an option to connect with your database using a standard URI, Database credentials or SSH.
Get Database credentials
Visit your application dashboard on Heroku, go to the Resources tab and click on Heroku Postgres. On the Datastores page, go to the Settings tab and click on View Credentials. You will get the Hostname, Database, User, Port, Password, URI and Heroku CLI information.
Connect to Database
You can use these credentials to connect to your database. For this article, I will be using the URI method. Copy the URI from the Heroku dashboard, paste it into the Scheme tab and click on connect button. This will open your database and the tables in it. You can get a lot of information about your databases such as tables, rows and table structure. Find out now yourself by following the steps above.
Thank you for reading this article. You can also subscribe to my newsletter to receive my articles straight to your inbox.
Be better than Yesterday's you!
Top comments (0)