diesel: error: cannot find macro `infer_schema!` in this scope
I’m following the tutorial step by step. In “src/schema.rs” I have only this single line:
infer_schema!("dotenv:DATABASE_URL");
And:
% cargo build
[................]
error: cannot find macro `infer_schema!` in this scope
--> src/schema.rs:1:1
|
1 | infer_schema!("dotenv:DATABASE_URL");
| ^^^^^^^^^^^^
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (8 by maintainers)
I asked help on the diesel-rs/diesel and @weiznich came to the rescue.
@weiznich quickly found out that I was missing a
macro_useannotation on theextern crate dieselimport. In fact, I was missing the entire import. Adding it in, made my problems go away, even without the altered recursion limit.Ah, I see. You’ll to enable the
large-tables(orhuge-tables) feature for diesel in yourCargo.toml. (It’s off by default to make diesel compile faster.)