Enhance temporary table name generation with random suffix for uniqueness#80
Merged
Enhance temporary table name generation with random suffix for uniqueness#80
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for multiple bulk insert operations within a single transaction by making temporary table names unique. Previously, temporary table names were deterministic based on the table name, which caused conflicts when multiple bulk inserts were performed in the same transaction.
Key changes:
- Introduced a
RandomStringhelper method to generate random alphanumeric strings - Updated all database provider implementations to append a random 6-character suffix to temporary table names
- Added a test case to verify multiple bulk inserts within a single transaction work correctly
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/PhenX.EntityFrameworkCore.BulkInsert/Helpers.cs | Added RandomString helper method to generate random alphanumeric strings |
| src/PhenX.EntityFrameworkCore.BulkInsert/BulkInsertProviderBase.cs | Updated base temp table naming to include random suffix |
| src/PhenX.EntityFrameworkCore.BulkInsert.SqlServer/SqlServerBulkInsertProvider.cs | Updated SQL Server temp table naming to include random suffix |
| src/PhenX.EntityFrameworkCore.BulkInsert.Sqlite/SqliteBulkInsertProvider.cs | Updated SQLite temp table naming to include random suffix |
| src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleBulkInsertProvider.cs | Updated Oracle temp table naming to include random suffix and fixed double underscore |
| src/PhenX.EntityFrameworkCore.BulkInsert.MySql/MySqlBulkInsertProvider.cs | Updated MySQL temp table naming to include random suffix |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Basic/BasicTestsBase.cs | Added test case for multiple bulk inserts within a transaction |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…cter random suffix for uniqueness and use Shared random generator
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.
Fixes #78