![]() The value of your-heroku-app-name is found on your Heroku dashboard, for example mystic-wind-83. Note that this command requires a postgres client to be installed locally, the easiest way on a Mac is via Homebrew: brew update & brew cleanup & brew install postgresql (actually installs both client and server but only client portion is needed). The basic structure of the command is: heroku pg:pull your-heroku-db-name target-local-db-name -app your-heroku-app-name It's run from a terminal (given that you've already authenticated via heroku login). Heroku provides a convenient pg:pull command to pull data from a production database on Heroku to a locally running database. For example, when working on a data visualization app, having real data can help to determine if the data viz is providing any insight. However, it can sometimes be useful to develop against real data. ![]() For local development you'd usually be using fake or test data (i.e. One thing you might like to do once there's some significant amount of production data in the database, is to make a copy of it to import into a locally running database. Since I'm not currently monetizing my side project, I selected the free tier, together with the Hobby Dev package for the database, which provides a limited amount of storage. ![]() Heroku is a PaaS (Platform as a Service) that makes it really easy to deploy web applications, and other related services such as a database. I recently starting using Heroku to deploy a side project built with Rails and Postgres. For a more detailed explanation, read on. ![]() TLDR: Use PG_HOST=127.0.0.1 when running Heroku's pg:pull to a local target database that is running in a Docker container. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |