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

infer_schema! fails to connect, even though diesel setup works #237

Closed
jgillich opened this Issue Mar 17, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@jgillich
Contributor

jgillich commented Mar 17, 2016

[nix-shell:~/devel/mp/server]$ diesel setup
Creating database: /tmp/mp.sqlite
Running migration 20160316155553

[nix-shell:~/devel/mp/server]$ cargo run
   Compiling server v0.1.0 (file:///home/jakob/devel/mp/server)
src/schema.rs:1:1: 1:40 error: failed to establish a database connection
src/schema.rs:1 infer_schema!(dotenv!("DATABASE_URL"));
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `server`.

To learn more, run the command again with --verbose.

[nix-shell:~/devel/mp/server]$ cat .env 
DATABASE_URL=/tmp/mp.sqlite

This even happens with DATABASE_URL=:memory:, so something isn't right. Running NixOS with a somewhat recent nightly.

Any suggestions as to how to debug this? --verbose doesn't print anything helpful unfortunately.

@jgillich

This comment has been minimized.

Contributor

jgillich commented Mar 17, 2016

Ah, I missed infer_schema only works with pg, so this will be fixed by #226

@jgillich jgillich closed this Mar 17, 2016

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