Today I Learned

A Hashrocket project

Heroku Psql Oneline šŸ˜

I cooked up this Heroku/subshell command today, and I like it:

$ psql $(heroku config:get DATABASE_URL)

This will connect me to the primary PostgreSQL database for my Heroku application in the psql client. Now Iā€™m ready to query!

NOTE: why not $ heroku pg:psql? Iā€™m not sure. I think Heroku was reporting status issues today, and I wanted to bypass any infrastructure I could.

Looking for help? Hashrocket developers believe that data quality is as important as code quality. We enjoy all the challenges of relational databases, from finding the fastest index, to structuring data to fit the needs of an application. We're eager to share our experiences; check out PG Casts, our series of free PostgreSQL screencasts.