Allow Bulk Insert for a specified list of columns (#311) - #359
Open
NTmatter wants to merge 1 commit into
Open
Conversation
Adds `bulk_insert_columns(self, table, columns)` and turns `bulk_insert(self, table)` into a compatibility shim that calls `self.bulk_insert_columns(table, &["*"])`, maintaining the existing behaviour.
MattJackson
added a commit
to MattJackson/tiberius-ng
that referenced
this pull request
Aug 29, 2026
joelparkerhenderson
added a commit
to mssql-rust/mssql-rust
that referenced
this pull request
Aug 29, 2026
Mirrors prisma/tiberius#359, fixes upstream issue #311. Client::bulk_insert_columns(table, columns) lets callers restrict and order the columns used in a BULK INSERT, so source data that doesn't cover every column or is in a different column order than the table can still use bulk_insert. bulk_insert(table) becomes a thin wrapper calling bulk_insert_columns(table, &["*"]). Ported the test macro to this fork's mssql/pastey naming. Verified live against a real SQL Server (Azure SQL Edge via rustls): all 8 new tests pass (default/override column subsets, both orderings, optional and NOT NULL variants), plus the full 88-test tests/bulk.rs suite. Also verified: 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
to MattJackson/tiberius-ng
that referenced
this pull request
Aug 29, 2026
…risma#397, prisma#217, prisma#403) Adapted from upstream prisma#398 (author @etylermoss), reconciled with the already-integrated bulk_insert_columns (prisma#359): - Client::column_metadata(table, columns) returns owned Vec<MetaDataColumn> (names, types, size/precision/scale, nullability, identity); bulk insert now shares this path. - MetaDataColumn::col_name()/base() accessors; BaseMetaDataColumn:: is_identity()/is_nullable()/ty()/flags() (resolves prisma#403).
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.
Adds
bulk_insert_columns(self, table, columns)and turnsbulk_insert(self, table)into a compatibility shim that callsself.bulk_insert_columns(table, &["*"]), maintaining the existing behaviour.This should simplify bulk inserts in cases where column order may be unpredictable, or only a subset of columns need to be inserted.