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

sqlx version mismatch error #240

Closed
Xavientois opened this issue Jul 6, 2022 · 1 comment
Closed

sqlx version mismatch error #240

Xavientois opened this issue Jul 6, 2022 · 1 comment

Comments

@Xavientois
Copy link
Contributor

When I try to call cargo shuttle run with the example postgres code from the docs, I get the following error:

error[E0308]: mismatched types
  --> src/lib.rs:16:17
   |
16 | async fn rocket(pool: PgPool) -> ShuttleRocket {
   |                 ^^^^ expected struct `Pool`, found struct `sqlx_core::pool::Pool`
   |
   = note: expected struct `Pool<Postgres>`
              found struct `sqlx_core::pool::Pool<sqlx_core::postgres::database::Postgres>`
   = note: perhaps two different versions of crate `sqlx_core` are being used?

My dependencies are:

shuttle-service = { version = "0.3.3", features = ["web-rocket", "sqlx-postgres"] }
sqlx = { version = "0.6", features = ["runtime-tokio-native-tls", "postgres"] }

Changing the sqlx version to 0.5 fixes the error, but I wonder what the best approach for avoiding this kind of version mismatch would be.

@oddgrd
Copy link
Contributor

oddgrd commented Jan 2, 2023

This hasn't been resolved, but I'm closing this in favor of #505 which is more descriptive. Thanks!

@oddgrd oddgrd closed this as completed Jan 2, 2023
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