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 does not build if feature rust_decimal is specified but bigdecimal is not #2549

Closed
illuminatedwax opened this issue Jun 15, 2023 · 5 comments
Labels

Comments

@illuminatedwax
Copy link

illuminatedwax commented Jun 15, 2023

Bug Description

error[E0432]: unresolved import `crate::types::numeric`
  --> /home/dranger/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-postgres-0.7.0-alpha.3/src/types/rust_decimal.rs:10:19
   |
10 | use crate::types::numeric::{PgNumeric, PgNumericSign};
   |                   ^^^^^^^ could not find `numeric` in `types`

error[E0432]: unresolved import `num_bigint`
 --> /home/dranger/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-postgres-0.7.0-alpha.3/src/types/rust_decimal.rs:1:5
  |
1 | use num_bigint::{BigInt, Sign};
  |     ^^^^^^^^^^ use of undeclared crate or module `num_bigint`
  1. num_bigint is not added unless "bigdecimal" is in features
  2. the types/numeric.rs mod is not added unless "bigdecimal" is in features, but rust_decimal relies on it anyway

Minimal Reproduction

In Cargo.toml:

sqlx = { version = "0.7.0-alpha.3", features = [ "runtime-tokio", "tls-rustls", "sqlite", "postgres", "json", "chrono", "rust_decimal", "uuid"] }

Info

  • SQLx version: 0.7.0-alpha.3
  • SQLx features enabled: "runtime-tokio", "tls-rustls", "sqlite", "postgres", "json", "chrono", "rust_decimal", "uuid"
  • Database server and version: None required
  • Operating system: Ubuntu Linux
  • rustc --version: rustc 1.71.0-nightly (d3f416dc0 2023-05-18)
@smonv
Copy link
Contributor

smonv commented Jun 19, 2023

I got the same problem while using version 0.7.0-alpha.3. I think rust_decimal still work on alpha 2 so not sure what problem. Right now switch to use bigdecimal

@Tarang
Copy link

Tarang commented Jul 4, 2023

Have this issue too on the SQLx release 0.7.0

@deneut
Copy link
Contributor

deneut commented Jul 5, 2023

This PR fixes the issue: #2585 but I don't think I linked it to this issue correctly.

abonander pushed a commit that referenced this issue Jul 6, 2023
…using "bigdecimal" (#2585)

* Fix missing num-bigint dependency for rust_decimal

* Fix missing feature name change from "decimal" to "rust_decimal"

* update missing "decimal"->"rust_decimal" renaming in range.rs

* Update money.rs references to "decimal"

* Update "decimal" -> "rust_decimal"
@billy1624
Copy link
Contributor

Hey @abonander, will we have a patch release soon?

@saiintbrisson
Copy link
Contributor

This was fixed by #2585

billy1624 added a commit to SeaQL/sea-query that referenced this issue Jul 19, 2023
tyt2y3 pushed a commit to SeaQL/sea-query that referenced this issue Jul 20, 2023
* Upgrade to SQLx v0.7

* Upgrade ipnetwork to v0.20

* Encode chrono types in Any driver as string

* Temporary enable `sqlx/bigdecimal` feature when `with-rust_decimal` is enabled (launchbadge/sqlx#2549)

* Fixup

* Fixup

* Fixup

* CI

* Fixup

* Revert "Temporary enable `sqlx/bigdecimal` feature when `with-rust_decimal` is enabled (launchbadge/sqlx#2549)"

This reverts commit fa50aa2.

* CI fmt checks

* Bump `sea-query-binder` to v0.5.0

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

No branches or pull requests

7 participants