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

Using PostgreSQL for Axum, with the latest sqlx 8.0 error #183

Closed
DK26 opened this issue Aug 6, 2024 · 2 comments
Closed

Using PostgreSQL for Axum, with the latest sqlx 8.0 error #183

DK26 opened this issue Aug 6, 2024 · 2 comments

Comments

@DK26
Copy link

DK26 commented Aug 6, 2024

Hi,

A new sqlx crate is out, and upgrading would cause the example to error with conflicts:

error: failed to select a version for `libsqlite3-sys`.
    ... required by package `sqlx-sqlite v0.7.1`
    ... which satisfies dependency `sqlx-sqlite = "=0.7.1"` of package `sqlx v0.7.1`
    ... which satisfies dependency `sqlx = "^0.7.1"` of package `shuttle-shared-db v0.47.0`
    ... which satisfies dependency `shuttle-shared-db = ">=0.47"` of package `test-postgresql v0.1.0 (/home/test/test-postgresql)`   
versions that meet the requirements `^0.26.0` are: 0.26.0

the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `libsqlite3-sys v0.28.0`
    ... which satisfies dependency `libsqlite3-sys = "^0.28.0"` of package `sqlx-sqlite v0.8.0`
    ... which satisfies dependency `sqlx-sqlite = "=0.8.0"` of package `sqlx v0.8.0`
    ... which satisfies dependency `sqlx = "^0.8.0"` of package `test-postgresql v0.1.0 (/home/test/test-postgresql)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "sqlite3"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `libsqlite3-sys` which could resolve this conflict

Playing around with it, disabling default features and specifying, did not solve the problem, which by this point has overwhelmed me.

Cargo.toml

[package]
name = "test-postgresql"
version = "0.1.0"
edition = "2021"

[dependencies]
axum = ">=0.7"
shuttle-axum = ">=0.47"
shuttle-runtime = ">=0.47"
shuttle-shared-db = {version = ">=0.47", features = ["postgres", "sqlx"] }
tokio = ">=1.39"
sqlx = ">=0.8"
@joshua-mo-143
Copy link
Contributor

Hi!

This issue will be resolved once the new version of shuttle-shared-db is released. A change has already been merged but we're waiting for the new release.

In the meantime, the latest supported SQLx version is 0.7.1.

@jonaro00
Copy link
Member

jonaro00 commented Jan 9, 2025

sqlx 0.8 is supported since v0.48.0

@jonaro00 jonaro00 closed this as completed Jan 9, 2025
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

3 participants