Add heroku-friendly db connection function.