Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropwizard DataSourceFactory on with just DATABASE_URL #1259

Closed
andersem opened this issue Sep 24, 2015 · 3 comments
Closed

Dropwizard DataSourceFactory on with just DATABASE_URL #1259

andersem opened this issue Sep 24, 2015 · 3 comments

Comments

@andersem
Copy link

Heroku and Dokku only offer a single DATABASE_URL when deploying an application. It would be convenient to create a DataSourceFactory using just this url.

The alternative is to parse the DATABASE_URL and pluck username and password from there, but this is error-prone and makes it hard to use different databases, like h2 in test.

Example database_url:

DATABASE_URL=postgres://postgres:SOME_PASSWORD@172.17.0.1:5432/lolipop

Example database-configuration:

database:
    driverClass: org.postgresql.Driver
    url: ${DATABASE_URL}

Also, see http://stackoverflow.com/questions/32705394/dropwizard-datasourcefactory-on-heroku-with-just-database-url

@andersem
Copy link
Author

dokku/dokku-postgres#22 shows a discussion about this for dokku

@arteam
Copy link
Member

arteam commented Sep 24, 2015

That's a reasonable feature request. #1260 should provide the ability to use inlined credentials.

@andersem
Copy link
Author

Incredible response time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants