https://linen.dev logo
failed to resolve could not find `Postgres` in `sh...
# help
b
Those are my dependencies from Cargo.toml
Copy code
toml
[dependencies]
shuttle-service = { version = "0.8.0" }
shuttle-shared-db = { version = "0.8.0", features = ["postgres"] }
dotenv = "0.15.0"
sqlx = { version = "0.6.2", features = [
    "runtime-tokio-native-tls",
    "postgres",
] }
And this is the code from lib.rs:
Copy code
rust
use main_service::MainService;

pub mod credentials;
pub mod db_service;
pub mod main_service;

async fn init(
    #[shuttle_shared_db::Postgres] pool: sqlx::PgPool,
) -> Result<MainService, shuttle_service::Error> {
    let main_service = MainService::new(pool)?;

    Ok(main_service)
}
It doesn't seem to recognize the #[shuttle_shared_db::Postgres] macro, any ideas?
w
Could you share the full stack-trace please?
Also I think you're missing
#[shuttle_service::main]
on top of your init function.
b
yup
I think that was it
w
Nice!
b
I recreated the project and it seemed to compile the second time
w
Awesome
b
thanks a lot! :P
w
No problem 🙂