I've just deployed my application to heroku and pointed my custom domain to the heroku servers. How can I check the records in my heroku database?
All Heroku Postgres databases have a corresponding Heroku application. You can find the application name on the database page at data.heroku.com. Your database is attached to the Heroku app and is accessible via an app config var containing the database URL, even if you host no code in the application itself.
From the application dashboard on Heroku, go to the 'resources' tab and search for postgres. Provision it and use the free option. There's now a clickable link to the Datastore associated with your application. Go ahead and open the link to your datastore, and take note of exactly how to get here again.
Heroku Postgres delivers the world's most advanced open source database as a trusted, secure, and scalable service that is optimized for developers.
You can use heroku run rails console
and look at your records with Model.all
or any other method.
If you want to backup the database look at heroku PG backups, you then can import your database on your local machine and look at it there. Depending on your db adapter you could use sqlite browser for sqlite3 or phpmyadmin for MySQL.
I found a similar question like this and here is what @Chowlett says:
"You could run heroku pg:psql
to fire up a Postgres console, then issue \d
to see all tables, and \d tablename
to see details for a particular table."
You can also type select * from tablename;
to view the table contents.
How to view current database schema for Heroku app in Terminal?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With