Skip to content

Instantly share code, notes, and snippets.

@guibeira
Created November 2, 2019 17:46
Show Gist options
  • Save guibeira/e05ae575c3cfac2000b7226aca809a48 to your computer and use it in GitHub Desktop.
Save guibeira/e05ae575c3cfac2000b7226aca809a48 to your computer and use it in GitHub Desktop.
easy way to connect to database using heroku name
#!/bin/bash
default_db="heroku config:get DATABASE_URL --app "
args=("$@")
DATABASE_URL=$($default_db ${args[0]})
PG_WEB="pgweb --url"
echo $(xdg-open http://localhost:8081/)
echo $($PG_WEB $DATABASE_URL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment