Skip to content

Make BulkOperations provider-agnostic beyond SQL Server #39

@cursor

Description

@cursor

Problem

BulkOperations<TEntity> is documented as supporting batched INSERT for non-SQL Server providers, but the implementation directly imports Microsoft.Data.SqlClient and uses SqlBulkCopy for SQL Server.

File: DBTools/Bulk/BulkOperations.cs

Non-SQL Server bulk paths may be incomplete or untested.

Proposed solution

  1. Abstract bulk insert behind IDbProvider or a dedicated IBulkInsert interface
  2. Keep SqlBulkCopy as SQL Server optimization only
  3. Implement/test batched INSERT fallback for PostgreSQL, MySQL, SQLite
  4. Add tests (see Add unit tests for async, context, bulk, interceptors, and mapping #28)

Acceptance criteria

  • No direct SqlConnection/SqlBulkCopy usage outside SQL Server code path
  • Bulk insert works (or fails clearly) per provider
  • Provider-specific behavior documented in README/API reference

Related

#28 (tests), #32 (multi-provider migration)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions