Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 2.5 Working with a Database: Injecting the database connection - fails accourding to trait bound shuttle_shared_db::Postgres: ResourceInputBuilder is not satisfied #25

Open
philipp10348r574kdfje opened this issue Mar 12, 2024 · 2 comments

Comments

@philipp10348r574kdfje
Copy link

Hello :)

I´m sorry for opening up a issue, but i can´t help me out.

As I was following the instructions from your Tutorial i ran into this error. I checked it multiple times and can say i exactly followed the instructions.

error[E0277]: the trait bound shuttle_shared_db::Postgres: ResourceInputBuilderis not satisfied --> api/shuttle/src/main.rs:11:7 #[shuttle_shared_db::Postgres()] pool: sqlx::PgPool, ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the traitResourceInputBuilderis not implemented forshuttle_shared_db::Postgres`

error[E0599]: no function or associated item named default found for struct shuttle_shared_db::Postgres in the current scope
--> api/shuttle/src/main.rs:9:1

#[shuttle_runtime::main]
|^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in Postgres
`

As an absolute beginner i would be very thankfull for a solution to this problem, i can´t figure out myself.

@philipp10348r574kdfje philipp10348r574kdfje changed the title Injecting the database connection - fails accourding to trait bound shuttle_shared_db::Postgres: ResourceInputBuilder is not satisfied Chapter 2.5 Working with a Database Injecting the database connection - fails accourding to trait bound shuttle_shared_db::Postgres: ResourceInputBuilder is not satisfied Mar 12, 2024
@philipp10348r574kdfje philipp10348r574kdfje changed the title Chapter 2.5 Working with a Database Injecting the database connection - fails accourding to trait bound shuttle_shared_db::Postgres: ResourceInputBuilder is not satisfied Chapter 2.5 Working with a Database: Injecting the database connection - fails accourding to trait bound shuttle_shared_db::Postgres: ResourceInputBuilder is not satisfied Mar 12, 2024
@Arnaud-Parion
Copy link

Arnaud-Parion commented Mar 25, 2024

Hello :)

I had the same issue. By looking at the shuttle repository : https://github.com/shuttle-hq/shuttle-examples/blob/main/actix-web/postgres/Cargo.toml
I found that you should replace the lines to paste in the api/shuttle/Cargo.toml file ( shuttle-shared-db = { version = "0.36.0", features = ["postgres"] }
sqlx = { version = "0.7", default-features = false, features = [
"tls-native-tls",
"macros",
"postgres",
"uuid",
"chrono",
"json",
] }), by those lines :
shuttle-shared-db = { version = "0.42.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"

@philipp10348r574kdfje
Copy link
Author

Hello Arnaud,

thank you for your support 🙏☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants