fix:修改在使用分页批量插入时,DmBulkCopy中BatchSize未赋值问题

This commit is contained in:
zj0135
2026-02-04 14:53:14 +08:00
parent 0e4893b389
commit 2cab82027b
3 changed files with 6 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ namespace SqlSugar
case DbType.Dm:
var result3= new DmFastBuilder();
result3.DbFastestProperties.IsOffIdentity = this.IsOffIdentity;
result3.DbFastestProperties.Size = this.Size;
return result3;
case DbType.ClickHouse:
var resultConnectorClickHouse = InstanceFactory.CreateInstance<IFastBuilder>("SqlSugar.ClickHouse.ClickHouseFastBuilder");

View File

@@ -16,5 +16,6 @@ namespace SqlSugar
public bool IsConvertDateTimeOffsetToDateTime { get; set; }
public bool NoPage { get; set; }
public bool IsIgnoreInsertError { get; internal set; }
public int Size { get; set; }
}
}

View File

@@ -64,6 +64,10 @@ namespace SqlSugar
{
DmBulkCopy bulkCopy = GetBulkCopyInstance();
bulkCopy.DestinationTableName = dt.TableName;
if (DbFastestProperties?.Size > 0)
{
bulkCopy.BatchSize = DbFastestProperties.Size;
}
try
{
bulkCopy.WriteToServer(dt);