In some cases, you may want your application to connect to a database that isn't hosted in Heroku. You can configure this connection by overriding the DATABASE_URL
command.
To override this variable, you must provide the connection parameters:
postgres://[username]:[password]@[host]/[database name]
The Heroku client has the config:set
command that allows you to define or override environment variables:
$ heroku config:set DATABASE_URL=' postgres://[username]:[password]@[host]/[database name]' -your-app-name Setting config vars and restarting your-app-name... done, v11 DATABASE_URL: postgres://[username]:[password] @[host]:5432/[database name]