Skip to content

Feature/implement oracle bulk insert provider bulk insert return entities#3

Open
alexanderklassen wants to merge 19 commits into
devfrom
feature/Implement-OracleBulkInsertProvider-BulkInsertReturnEntities
Open

Feature/implement oracle bulk insert provider bulk insert return entities#3
alexanderklassen wants to merge 19 commits into
devfrom
feature/Implement-OracleBulkInsertProvider-BulkInsertReturnEntities

Conversation

@alexanderklassen

@alexanderklassen alexanderklassen commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and clarifications to the Oracle provider and documentation for the bulk insert library. The main changes include enhanced documentation of upsert behavior, a new limitation note regarding Oracle transaction rollback, and significant improvements to the Oracle upsert implementation to ensure primary key and match columns are never overwritten. Additionally, it adds a project-specific NuGet.config for more reliable package restores and minor code quality improvements.

Documentation updates and limitations:

  • Clarified that primary key and Match columns are never overwritten during upsert operations, even if specified in the Update expression, in both README.md and docs/documentation.md. Also explained how constant expressions are handled in upsert expressions. [1] [2]
  • Added a new Oracle-specific limitation to docs/limitations.md: upsert operations using ExecuteBulkInsertReturnEntities cannot be rolled back in a transaction due to Oracle's implicit commit on DDL statements.

Oracle provider upsert and insert improvements:

  • Updated the Oracle provider to ensure that upsert operations never overwrite primary key or match columns and to improve the generated SQL for upserts. This includes logic to exclude these columns from updates and to place the update condition in the correct location for Oracle's MERGE statement. [1] [2]
  • Improved the implementation of returning entities after bulk insert/upsert in Oracle by using PL/SQL blocks that collect and map ROWIDs, ensuring the correct entities are returned.
  • Enhanced SQL literal generation for Oracle, including correct formatting for GUIDs and trimming strings.

Build and configuration:

  • Added a repository-specific NuGet.config to ensure package restores use only nuget.org, avoiding unreliable internal mirrors during local development.

Miscellaneous:

  • Added a missing using directive for extensions in the Oracle provider for consistency and clarity.
  • Added a user-specific .DotSettings.user file, likely for IDE/test session state (not affecting library behavior).

DPschichholz and others added 10 commits May 21, 2026 09:02
- Fix double-schema qualification when EF Core default schema is configured
- Clarify table name handling comment
…#2)

* Remove trailing semicolon from SQL statements in OracleDialectBuilder and add unit tests to prevent regressions

---------

Co-authored-by: Alexander Klassen <alexander.klassen@dedalus.com>
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleDialectBuilder.cs Outdated
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert/Dialect/SqlDialectBuilder.cs Outdated
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert/Dialect/SqlDialectBuilder.cs Outdated
Comment thread tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/Program.cs Outdated
Comment thread tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/Program.cs Outdated
Comment thread PhenX.EntityFrameworkCore.BulkInsert.sln.DotSettings.user Outdated
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert/Metadata/ColumnMetadata.cs Outdated
null => "NULL",
RawSqlValue rawSqlValue => rawSqlValue.Sql,
Guid guid => FormatGuid(guid),
string s => $"'{s}'",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

' escapen?

// Numeric and other formattable values must use the invariant culture so that, for example,
// a decimal is rendered as "42.5" and not the culture-specific "42,5" which is invalid SQL.
IFormattable formattable => formattable.ToString(null, CultureInfo.InvariantCulture),
_ => value.ToString() ?? "NULL",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Kann zu Fehlern führen
throw?

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.

3 participants