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

Missing support for NUMERIC[] using rust_decimal #1778

Closed
tm-drtina opened this issue Apr 3, 2022 · 2 comments · Fixed by #1781
Closed

Missing support for NUMERIC[] using rust_decimal #1778

tm-drtina opened this issue Apr 3, 2022 · 2 comments · Fixed by #1781
Labels
db:postgres Related to PostgreSQL

Comments

@tm-drtina
Copy link
Contributor

tm-drtina commented Apr 3, 2022

I've encountered an issue when I had $1::numeric[] in a query and the compiler reported:

error: optional feature bigdecimal required for type NUMERIC[] of param # 1

It seems there is a support for NUMERIC type using rust_decimal crate with feature = "decimal", but not for NUMERIC[] type.

Is it just missing implementation here for decimal feature?

#[cfg(feature = "bigdecimal")]
Vec<sqlx::types::BigDecimal> | &[sqlx::types::BigDecimal],

Edit: I've tried to just "blindly" copy&paste the bigdecimal impl and it seems to just work https://github.com/tm-drtina/sqlx/commit/b9d48baf173bf5cd2c5b2fe4deb04ecfdf6652d6

@abonander
Copy link
Collaborator

Sounds like a simple oversight, if you want to open a PR with your fix we'd accept it.

@tm-drtina
Copy link
Contributor Author

PR opened, I've rebased it on master, since I'm using that branch are cargo patch of 0.5.11

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

Successfully merging a pull request may close this issue.

2 participants