Repository navigation
Conversation
MattJackson
referenced
this pull request
in MattJackson/tiberius-ng
Aug 29, 2026
From upstream #376 (author Eric Sheppard) — the numeric.rs IntoSql impl only; the PR's stale edits to CI/TLS files (already covered by #419) are omitted. Lets a rust_decimal Decimal be bound directly in queries.
joelparkerhenderson
added a commit
to mssql-rust/mssql-rust
that referenced
this pull request
Aug 29, 2026
Cherry-picks just the decimal hunk of tiberius-rs/tiberius#376. Its other hunks (CI actions/cache v2->v4, several event! log levels changed from INFO to DEBUG) were dropped: the CI bump is already superseded here (this fork's CI is SHA-pinned to actions/cache v5.0.5, see tasks.md's "Already superseded" section) and the log-level changes are unrelated to the decimal fix, so they're left for a separate change if wanted. `Decimal` already had `FromSql` and `ToSql` (borrowed) impls but was missing `IntoSql` (owned/consuming) - the same gap `BigDecimal` didn't have, since it already has all three. This meant `Decimal` values couldn't be used with APIs that consume rather than borrow, notably `TokenRow::push(value.into_sql())` for bulk_insert. Added a regression test proving this: `test_bulk_type!(decimal(...))` in tests/bulk.rs, which expands to bulk-insert tests calling `i.into_sql()` - confirmed this fails to compile without the fix ("no method named `into_sql` found for struct `Decimal`") and compiles and passes live with it. Verified: - cargo check: default, --features=rustls, --features=vendored-openssl, --no-default-features, --features=rust_decimal,tds73 - cargo clippy --all-targets -- -D warnings, for default and rust_decimal,tds73,rustls - cargo fmt --check - cargo test --lib --features=rust_decimal,tds73 (176 passed) - Live integration tests over rustls: 305 passed (102 bulk + 203 query, including the new decimal bulk-insert tests) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0156Di1tRRLsJK8ctU1AmAJr
joelparkerhenderson
added a commit
to mssql-rust/mssql-rust
that referenced
this pull request
Aug 30, 2026
Cherry-picks just the decimal hunk of tiberius-rs/tiberius#376. Its other hunks (CI actions/cache v2->v4, several event! log levels changed from INFO to DEBUG) were dropped: the CI bump is already superseded here (this fork's CI is SHA-pinned to actions/cache v5.0.5, see tasks.md's "Already superseded" section) and the log-level changes are unrelated to the decimal fix, so they're left for a separate change if wanted. `Decimal` already had `FromSql` and `ToSql` (borrowed) impls but was missing `IntoSql` (owned/consuming) - the same gap `BigDecimal` didn't have, since it already has all three. This meant `Decimal` values couldn't be used with APIs that consume rather than borrow, notably `TokenRow::push(value.into_sql())` for bulk_insert. Added a regression test proving this: `test_bulk_type!(decimal(...))` in tests/bulk.rs, which expands to bulk-insert tests calling `i.into_sql()` - confirmed this fails to compile without the fix ("no method named `into_sql` found for struct `Decimal`") and compiles and passes live with it. Verified: - cargo check: default, --features=rustls, --features=vendored-openssl, --no-default-features, --features=rust_decimal,tds73 - cargo clippy --all-targets -- -D warnings, for default and rust_decimal,tds73,rustls - cargo fmt --check - cargo test --lib --features=rust_decimal,tds73 (176 passed) - Live integration tests over rustls: 305 passed (102 bulk + 203 query, including the new decimal bulk-insert tests) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0156Di1tRRLsJK8ctU1AmAJr
This was referenced Sep 1, 2026
Closed
Contributor
|
Included in #441 — shipped in tiberius v0.13.0. Thanks for this! Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These features seem to have been omitted for Decimal so I've added
IntoSqlimps - because it is a copy type the implementation is identical to that ofToSql