You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let _core_count = thread::available_parallelism()?.get();
let pool = PgPoolOptions::new()
.max_connections(5)
.connect("postgres://postgres:password@localhost/test").await?;
println!("Got Here!");
Ok(())
}
but get the following compiler message...
error[E0583]: file not found for module postgres
--> /home/cyril/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-core-0.7.4/src/database/mod.rs:166:1
|
166 | mod postgres;
| ^^^^^^^^^^^^^
|
= help: to create the module postgres, create file "/home/cyril/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-core-0.7.4/src/database/postgres.rs" or "/home/cyril/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-core-0.7.4/src/database/postgres/mod.rs"
= note: if there is a mod postgres elsewhere in the crate already, import it with use crate::... instead
I am new to Rust so please forgive the "noobie" question.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I included...
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "time", "uuid"] }
in my "cargo.toml" file have this as my "main.rs"...
use anyhow::Context;
use sqlx::postgres::PgPoolOptions;
use std::{thread};
#[tokio::main]
async fn main() -> Result<(), sqlx::Error> {
}
but get the following compiler message...
error[E0583]: file not found for module
postgres
--> /home/cyril/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-core-0.7.4/src/database/mod.rs:166:1
|
166 | mod postgres;
| ^^^^^^^^^^^^^
|
= help: to create the module
postgres
, create file "/home/cyril/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-core-0.7.4/src/database/postgres.rs" or "/home/cyril/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-core-0.7.4/src/database/postgres/mod.rs"= note: if there is a
mod postgres
elsewhere in the crate already, import it withuse crate::...
insteadI am new to Rust so please forgive the "noobie" question.
Beta Was this translation helpful? Give feedback.
All reactions