DuckDbBulkInsertMapItem
A mapping class used to define a source-to-destination column mapping for the DuckDB bulk operations.
This class extends BulkInsertMapItem to define a source-to-destination column mapping for the DuckDB bulk operations. Unlike some other providers’ mapping classes, it carries no per-mapping database-type override — the destination column’s type is always resolved from the table’s own schema.
Used by the DuckDB BulkInsert, BulkMerge and BulkUpdate operations.
Create a new Instance
var mapItem = new DuckDbBulkInsertMapItem("SourceId", "DestinationId");
Usage for BulkOperations
var mappings = new []
{
new DuckDbBulkInsertMapItem("FirstName", "FName"),
new DuckDbBulkInsertMapItem("LastName", "LName")
};
using (var connection = new DuckDBConnection(ConnectionString))
{
var people = GetPeople(100000);
connection.BulkInsert(people, mappings: mappings);
}
The same approach applies to BulkMerge and BulkUpdate. The
mappingsargument is optional — omitting it causes the library to auto-map columns by name (case-insensitive).