Typically the schema module isn't created by hand, it gets generated by Diesel. When we ran diesel setup, a file called diesel.toml was created which tells Diesel to maintain a file at src/schema.rs for us. The file should look like this
diesel.toml 文件是有了，但是我没搞懂 src/schema.rs 是怎么生成的
error[E0583]: file not found for module `schema` --> src/lib.rs:1:9 | 1 | 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_demo`.
环境： cargo 1.36.0-nightly (6be12653d 2019-04-19)