Skip to content

Implement Sql Traits into ColumnData - #314

Closed
LazyDope wants to merge 1 commit into
tiberius-rs:mainfrom
LazyDope:sqltraits-coldata
Closed

LazyDope wants to merge 1 commit into
tiberius-rs:mainfrom
LazyDope:sqltraits-coldata

Conversation

@LazyDope

Copy link
Copy Markdown
Contributor

Allows using ColumnData as parameters for queries, if you wanted to generically store various types of valid SQL data in one place and bind it directly instead of first converting out of ColumnData, which would of course just convert back to ColumnData as soon as it's put into the query bind. Instead you can just store ColumnData, and provide it to the bind method directly, without any converting back and forth since IntoSql just takes ownership of the ColumnData.

This also resolves my earlier issue of getting generic data from a row by name, however both of these solutions have their own merits by themselves.

joelparkerhenderson added a commit to mssql-rust/mssql-rust that referenced this pull request Aug 29, 2026
Mirrors tiberius-rs/tiberius#314. Lets a ColumnData already read from one
row be bound straight back into a query parameter -- e.g. copying a
value between statements, or generic code that already deals in
ColumnData -- without round-tripping it through a concrete Rust type
first. All four impls are trivial passthroughs (clone/self).

Added a small unit test exercising all four traits' round trip.

Verified: cargo check across all 6 CI feature combinations, cargo
clippy --all-targets, cargo fmt --check, and cargo test --lib (153
passing) all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156Di1tRRLsJK8ctU1AmAJr
MattJackson referenced this pull request in MattJackson/tiberius-ng Aug 29, 2026
joelparkerhenderson added a commit to mssql-rust/mssql-rust that referenced this pull request Aug 30, 2026
Mirrors tiberius-rs/tiberius#314. Lets a ColumnData already read from one
row be bound straight back into a query parameter -- e.g. copying a
value between statements, or generic code that already deals in
ColumnData -- without round-tripping it through a concrete Rust type
first. All four impls are trivial passthroughs (clone/self).

Added a small unit test exercising all four traits' round trip.

Verified: cargo check across all 6 CI feature combinations, cargo
clippy --all-targets, cargo fmt --check, and cargo test --lib (153
passing) all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0156Di1tRRLsJK8ctU1AmAJr
MattJackson added a commit that referenced this pull request Sep 3, 2026
MattJackson added a commit that referenced this pull request Sep 4, 2026
MattJackson added a commit that referenced this pull request Sep 6, 2026
MattJackson added a commit that referenced this pull request Sep 16, 2026
MattJackson added a commit that referenced this pull request Sep 24, 2026
@MattJackson

Copy link
Copy Markdown
Contributor

Included in #442 — shipped in tiberius v0.13.0. Thanks for this! Closing.

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

Successfully merging this pull request may close these issues.

2 participants