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

diesel setup doesn't work with some postgres URIs #247

Closed
voidxnull opened this Issue Mar 31, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@voidxnull

voidxnull commented Mar 31, 2016

For example, I need to specify a username and password, so I've created an .env file containing:
DATABASE_URL=postgres://dev:password@localhost/my_db

When I run diesel setup it panics with:

Creating database: my_db
thread '<main>' panicked at 'FATAL:  database "dev" does not exist
', /home/user/.multirust/toolchains/nightly/cargo/registry/src/github.com-88ac128001ac3a9a/diesel_cli-0.5.3/src/main.rs:235
note: Run with `RUST_BACKTRACE=1` for a backtrace.
@mcasper

This comment has been minimized.

Collaborator

mcasper commented Mar 31, 2016

Sorry about that!

Turns out that when dropping/creating a database, we connect to the user's DATABASE_URL minus the database, so if a user is supplied, we would connect to postgres://user@localhost, which postgres interprets as us wanting to connect to the user database as well.

Anyways, I pushed up a fix here: #248

@sgrif sgrif closed this in #248 Mar 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment