Skip to content

Get TokenRow from Row - #331

Closed
lpj145 wants to merge 2 commits into
tiberius-rs:mainfrom
lpj145:main
Closed

lpj145 wants to merge 2 commits into
tiberius-rs:mainfrom
lpj145:main

Conversation

@lpj145

@lpj145 lpj145 commented Feb 17, 2024

Copy link
Copy Markdown

We're working with stream out from sql server, this implementation will improve it a lot.

We're working with stream out from sql server, this implementation will improve it a lot.
@lpj145

lpj145 commented Feb 17, 2024 •

Copy link
Copy Markdown
Author

@tomhoule please take a look at this, it's very simple.

With that way we should achieve something like this interation:

let sql_meta: ResultMetadata;
let token_row : TokenRow = stream.into();
for column_index in sql_meta.columns().len() {
    match token_row.get(column_index) {
      // match column data types
    }
}

@tomhoule

Copy link
Copy Markdown
Contributor

Unfortunately I'm not the owner of this crate anymore.

@ghost

ghost commented Apr 15, 2024

Copy link
Copy Markdown

This pull request is very much needed

Thanks @lpj145

@pimeys

pimeys commented Apr 15, 2024

Copy link
Copy Markdown
Contributor

Unfortunately I'm also not the owner of this crate anymore either.

joelparkerhenderson added a commit to mssql-rust/mssql-rust that referenced this pull request Aug 29, 2026
Mirrors tiberius-rs/tiberius#331. Lets a Row streamed out of a SELECT be fed
straight back into e.g. a bulk_insert send() without manually copying
each cell.

Implemented as From<Row> for TokenRow instead of the PR's Into<TokenRow>
for Row: an Into-only impl with no matching From fails this fork's own
`-D warnings` clippy gate (`clippy::from_over_into`), since an explicit
From always gives you Into for free and the reverse isn't true.

Added a live integration test: read a row out, convert it to a
TokenRow, bulk_insert it back into the same table, and confirm both
rows round-trip correctly.

Verified live against a real SQL Server (Azure SQL Edge via rustls),
plus: cargo check across all 6 CI feature combinations, cargo clippy
--all-targets, cargo fmt --check, and cargo test --lib (153 passing).

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
Adapted from upstream #331 (author @lpj145).
joelparkerhenderson added a commit to mssql-rust/mssql-rust that referenced this pull request Aug 30, 2026
Mirrors tiberius-rs/tiberius#331. Lets a Row streamed out of a SELECT be fed
straight back into e.g. a bulk_insert send() without manually copying
each cell.

Implemented as From<Row> for TokenRow instead of the PR's Into<TokenRow>
for Row: an Into-only impl with no matching From fails this fork's own
`-D warnings` clippy gate (`clippy::from_over_into`), since an explicit
From always gives you Into for free and the reverse isn't true.

Added a live integration test: read a row out, convert it to a
TokenRow, bulk_insert it back into the same table, and confirm both
rows round-trip correctly.

Verified live against a real SQL Server (Azure SQL Edge via rustls),
plus: cargo check across all 6 CI feature combinations, cargo clippy
--all-targets, cargo fmt --check, and cargo test --lib (153 passing).

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.

4 participants