Hello all, attempting to learn Rust, and am importing external create Postgres.
I have added the required information that is needed "I think". I have tried several different variants all end the same =/. Have been using the examples provided here postgres How do I fix this? (I am attempting to read the documentation, but not everything is making sense ). Any/all help very much appreciated.
error[E0432]: unresolved import `postgres::Connection`
--> src/main.rs:1:5
|
1 | use postgres::Connection;
| ^^^^^^^^^^----------
| | |
| | help: a similar name exists in the module (notice the capitalization): `connection`
| no `Connection` in the root
error[E0433]: failed to resolve: use of undeclared type `TlsMode`
--> src/main.rs:21:72
|
21 | let conn = Connection::connect("postgresql://rust@localhost:5433", TlsMode::None).unwrap();
| ^^^^^^^ use of undeclared type `TlsMode`
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `unnamed` due to 2 previous errors
smoke@smoke:~/Rust/unnamed$ cargo run
Compiling unnamed v0.1.0 (/home/smoke/Rust/unnamed)
error[E0432]: unresolved imports `postgres::Connection`, `postgres::TlsMode`
--> src/main.rs:1:16
|
1 | use postgres::{Connection, TlsMode};
| ^^^^^^^^^^ ^^^^^^^ no `TlsMode` in the root
| |
| no `Connection` in the root
| help: a similar name exists in the module (notice the capitalization): `connection`