Skip to content

Enhance temporary table name generation with random suffix for uniqueness#80

Merged
PhenX merged 3 commits intomainfrom
bugfix/issue-78
Oct 30, 2025
Merged

Enhance temporary table name generation with random suffix for uniqueness#80
PhenX merged 3 commits intomainfrom
bugfix/issue-78

Conversation

@PhenX
Copy link
Copy Markdown
Owner

@PhenX PhenX commented Oct 29, 2025

Fixes #78

@PhenX PhenX requested a review from Copilot October 29, 2025 22:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RandomString helper 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.

Comment thread src/PhenX.EntityFrameworkCore.BulkInsert/Helpers.cs Outdated
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleBulkInsertProvider.cs Outdated
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleBulkInsertProvider.cs Outdated
…cter random suffix for uniqueness and use Shared random generator
@PhenX PhenX merged commit aacc5cd into main Oct 30, 2025
2 checks passed
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.

relation "_temp_bulk_insert_{TableName}" already exists

2 participants