Diesel version:
diesel = { version = "0.12.0", features = ["postgres"] }
diesel_codegen = { version = "0.12.0", features = ["postgres"] }
Rust: rustc 1.17.0-nightly (0aeb9c129 2017-03-15)
I have a User model with an UUID:
-- Your SQL goes here
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR NOT NULL,
password TEXT NOT NULL,
)
The infer_schema! macro fails everytime however:
infer_schema!("dotenv:DATABASE_URL");
error[E0412]: cannot find type `Uuid` in this scope
--> dutrack-lib/src/db/schema.rs:3:1
|
3 | infer_schema!("dotenv:DATABASE_URL");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
`use uuid::Uuid;`
= note: this error originates in a macro outside of the current crate
I tried importing Uuid into the scope in db/schema.rs but this didn't help either.
Nevermind, just saw that I need to add uuid to my features in the Cargo.toml.
Most helpful comment
Nevermind, just saw that I need to add
uuidto my features in theCargo.toml.