Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRaise more useful error if mismatch between feature enabled and db url #1124
Comments
killercup
added
the
enhancement
label
Aug 28, 2017
This comment has been minimized.
|
To clarify, specifically I think we should be checking for the URL starting with |
This comment has been minimized.
|
Related: We should strip |
This comment has been minimized.
bbqsrc
commented
Jul 2, 2018
|
This just broke my mind for a while, as I changed computers and couldn't understand the error that diesel-cli was giving me. Trying to connect to a postgres db with only the sqlite feature enabled provides the following:
So yeah, this is still less than ideal. :) |
This comment has been minimized.
christiansakai
commented
Oct 16, 2018
|
I literally just encountered this problem and went on for 2 days.... Glad I found this issue. |
This comment has been minimized.
|
I'll take a look at implementing this |
katrinabrock commentedAug 20, 2017
@sgrif
Problem Description
If proper features are not enabled, error messages to not point to this being the issue.
What are you trying to accomplish?
Started project with one backend, switched to a different backend and forgot to change
Cargo.toml.What is the expected output?
If
DATABASE_URLis for a database where feature is not enabled, there should at least be a warning about this.What is the actual output?
help: message: Could not load table names from databasepostgresql://sammy:sammy@localhost/diesel_demo
: StringError("Failed to establish a database connection a t postgresql://sammy:sammy@localhost/diesel_demo. Error: BadConnection(\"Unable to open the database file\")")Steps to reproduce
Cargo.toml
[dependencies] diesel = { version = "0.15.0", features = ["sqlite"] } diesel_codegen = { version = "0.15.0", features = ["sqlite"] } dotenv = "0.9.0".env
DATABASE_URL=postgres://username:password@localhost/diesel_demo > .envChecklist