Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds Oracle support to the bulk insert functionality. Key changes include:
- Adding Oracle-specific DbContext and test container classes.
- Introducing an Oracle bulk insert provider and its supporting classes (dialect builder, options, and DbContext options extension).
- Updating benchmarks, project files, and documentation to incorporate Oracle support.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/DbContext/TestDbContext.cs | Removed an extraneous blank line and added Oracle DbContext. |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/DbContainer/TestDbContainerOracle.cs | Added an Oracle test container with connection configuration adjustments. |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/Providers/LibComparatorOracle.cs | Introduced a benchmark comparator for Oracle. |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/Program.cs | Updated benchmark runner to include Oracle tests. |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/PhenX.EntityFrameworkCore.BulkInsert.Benchmark.csproj | Included Oracle package reference and project reference. |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/LibComparator.cs | Added Oracle branch in raw insert logic. |
| tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/LibComparator.RawInsert.cs | Added raw Oracle bulk insert implementation using OracleBulkCopy. |
| tests/PhenX.EntityFrameworkCore.BulkInsert/BulkInsertProviderBase.cs | Updated logic to conditionally skip adding an ID column for providers that do not require it. |
| src/PhenX.EntityFrameworkCore.BulkInsert/Extensions/InternalExtensions.cs | Adapted provider checking to support multiple provider types. |
| src/PhenX.EntityFrameworkCore.BulkInsert/Enums/ProviderType.cs | Extended enum to include Oracle. |
| src/PhenX.EntityFrameworkCore.BulkInsert.Sqlite/SqliteBulkInsertProvider.cs | Renamed temp table format to be more generic. |
| src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/* | New Oracle provider classes, options, and dialect implementations. |
| README.md | Updated documentation to mention Oracle support and added relevant benchmarks. |
| PhenX.EntityFrameworkCore.BulkInsert.sln | Included the new Oracle project in the solution. |
Comments suppressed due to low confidence (1)
src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleBulkInsertProvider.cs:23
- [nitpick] Using '#' as a prefix in the generated temporary table name could conflict with Oracle naming conventions. Consider revising the naming to ensure compatibility with Oracle identifier rules.
protected override string GetTempTableName(string tableName) => "$#temp_bulk_insert_{Guid.NewGuid().ToString("N")[..8]}";
…rtProvider.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SebastianStehle
left a comment
There was a problem hiding this comment.
LGTM. Only super small thing
|
|
||
| foreach (var column in columns) | ||
| { | ||
| q.Append($"{column.QuotedColumName} {column.StoreDefinition}"); |
There was a problem hiding this comment.
I think I have made an extension method for this case AppenJoined(",\n", column, (c, sb) => sb.Append("...")); or something like that
| protected override string AddTableCopyBulkInsertId => ""; // No need to add an ID column in Oracle | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override string GetTempTableName(string tableName) => $"#temp_bulk_insert_{Guid.NewGuid().ToString("N")[..8]}"; |
There was a problem hiding this comment.
Why do you not take the whole guid?
There was a problem hiding this comment.
oracle under a certain version (12 I think) does not allow indentifiers longer than 30, yay
There was a problem hiding this comment.
I would probably comment that, because I would have forgotten that next week.
There was a problem hiding this comment.
oh I will remember 😅 but yeah I'll add a comment
There was a problem hiding this comment.
I ahve said this very often to myself :D
| { | ||
| /// <inheritdoc cref="OracleBulkCopyOptions"/> | ||
| public OracleBulkCopyOptions CopyOptions { get; set; } = OracleBulkCopyOptions.Default; | ||
|
|
|
|
||
| q.AppendLine(";"); | ||
|
|
||
| var result = q.ToString(); |
There was a problem hiding this comment.
Have you not got rid of this syntax in another PR
aka
return q.ToString();
| } | ||
| } | ||
|
|
||
| // No conflict handling |
There was a problem hiding this comment.
Perhaps two methods so that the comments are not necessary?
# Conflicts: # tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/GetValueComparator.cs
Fixes #46
It is really partial for now, only supports the basic features, and not returning, even though there is some code to support it, in the future