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 updiesel.toml and schema.rs not created/generated #1726
Comments
This comment has been minimized.
|
This is a new feature in Diesel 1.3. Please install the latest version of Diesel by running |
sgrif
closed this
May 23, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hanckmann commentedMay 23, 2018
When following the tutorial (http://diesel.rs/guides/getting-started/) it is stated that the diesel.toml and the schema.rs are automatically generated.
From the documentation it seems that the schema.rs should be updated every time a diesel migration is executed. The diesel.toml should be generated after executing diesel setup.
When following the tutorial (copy-pasting the command, but changing it into sqlite), these two files are not created/generated.
I realise that there are some issues using rust nightly with diesel. Therefore I reverted nightly to an older version (see below). If diesel is also broken for that nightly version, it would be great if you can point me to a version in which diesel works correctly. Note that my aim is to integrate this in a rocket webservice. Therefore I am on nightly.
Setup
The tutorial is followed by copy-pasting, but with the following changes:
-- diesel = { version = "1.0.0", features = ["postgres"] }
++diesel = { version = "1.0.0", features = ["sqlite"] }
echo DATABASE_URL=/tmp/test_examples_2.sqlite > .env
-- id SERIAL PRIMARY KEY,
++ id INTEGER PRIMARY KEY,
-- use diesel::pg::PgConnection;
++ use diesel::pg::PgConnection;
-- pub fn establish_connection() -> PgConnection {
++ pub fn establish_connection() -> SqliteConnection {
-- PgConnection::establish(&database_url)
++ pub fn establish_connection() -> PgConnection {
Versions
Feature Flags
Problem Description
When running cargo run --bin show_posts right after the tutorial shows the content of the file: src/bin/show_posts.rs
The following error appears:
λ /tmp/diesel_demo3/ master* cargo run --bin show_posts Updating registryhttps://github.com/rust-lang/crates.io-index`Compiling unicode-xid v0.1.0
Compiling libc v0.2.41
Compiling void v1.0.2
Compiling pkg-config v0.3.11
Compiling ucd-util v0.1.1
Compiling lazy_static v1.0.0
Compiling regex v0.2.11
Compiling utf8-ranges v1.0.0
Compiling byteorder v1.2.3
Compiling unreachable v1.0.0
Compiling proc-macro2 v0.3.8
Compiling regex-syntax v0.5.6
Compiling memchr v2.0.1
Compiling thread_local v0.3.5
Compiling libsqlite3-sys v0.9.1
Compiling aho-corasick v0.6.4
Compiling quote v0.5.2
Compiling syn v0.13.11
Compiling dotenv v0.9.0
Compiling diesel_derives v1.3.0
Compiling diesel v1.3.0
Compiling diesel_demo3 v0.1.0 (file:///tmp/diesel_demo3)
error[E0583]: file not found for module
schema--> src/lib.rs:5:9
|
5 | pub mod schema;
| ^^^^^^
|
= help: name the file either schema.rs or schema/mod.rs inside the directory "src"
error: aborting due to previous error
For more information about this error, try
rustc --explain E0583.error: Could not compile
diesel_demo3.To learn more, run the command again with --verbose.
`
What are you trying to accomplish?
To get this to work :-)
What is the expected output?
What is the actual output?
Are you seeing any additional errors?
No additional errors
Steps to reproduce
I think I added all changes iof the tutorial code in my descriptions above. It is no issue to send you the actual code if required.
Checklist