Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking at the database on heroku

I am attempting to take a look at the data on my heroku instance. I'd like to be able to view the database on their server..

I don't want to pull it down to my local system.. More to the point I don't want wait that long, to take a look at the data.

Lets assume I push my current database of 8 million books(and all the meta data associated) up to heroku. Then in two months I add another 12 million. (I'm still in development mode) If I have a problem with one batch of data, I don't think it's feasible to pull down the whole database.

I suppose I could do crunches while I wait on the download of the gigs of data. I hear that's what old programmers did during compiles.


I've looked at Viewing database in Heroku and it's just a "Can't do it."
Is that true? We can't look at the live data?

like image 521
baash05 Avatar asked Feb 13 '12 01:02

baash05


3 Answers

You can use JackDB (http://www.jackdb.com).

JackDB is a database client in your web browser that has OAuth integration with Heroku. It lets you list your Heroku apps and their respective datasources and then connect to them to run SQL queries. See the docs for details of how to use it with Heroku.

Here's what it looks like:


There's also the JackDB Heroku plugin for the Heroku CLI. The plugin let's you run heroku jackdb from your command line to connect to your default database. There are additional options if you have more than one database and want to explicitly select which one you'd like to connect to.

To install it:

$ heroku plugins:install https://github.com/jackdb/jackdb-heroku-plugin.git

To connect to your default database:

$ heroku jackdb

Full disclosure: I'm the founder of JackDB.

like image 138
sehrope Avatar answered Oct 12 '22 12:10

sehrope


From https://devcenter.heroku.com/articles/heroku-postgresql

Heroku Postgres can be attached to a Heroku application via the CLI: $ heroku addons:add heroku-postgresql:dev

To establish a psql session with your remote database use heroku pg:psql.

like image 14
qix Avatar answered Oct 12 '22 11:10

qix


Try

heroku pg:psql

You'll get to know next steps automatically

like image 7
samarth Avatar answered Oct 12 '22 11:10

samarth