How do I check the records of my heroku database? How do I check the records of my heroku database? ruby ruby

How do I check the records of my heroku database?


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?


heroku db:pull to pull your production DB locally to take a peek in it.