v3.2.666-preview20220803 修复 Clickhouse Insert AsTable 表名处理 bug;

This commit is contained in:
2881099
2022-08-01 17:36:32 +08:00
parent 7ce0764670
commit 034b4735f4
3 changed files with 50 additions and 5 deletions

View File

@ -57,14 +57,14 @@ namespace FreeSql.ClickHouse.Curd
{
before = new Aop.CurdBeforeEventArgs(_table.Type, _table, Aop.CurdType.Insert, null, _params);
_orm.Aop.CurdBeforeHandler?.Invoke(this, before);
var data = ToDataTable();
using (var conn = _orm.Ado.MasterPool.Get())
{
using var bulkCopyInterface = new ClickHouseBulkCopy(conn.Value as ClickHouseConnection)
{
DestinationTableName = _table.DbName,
DestinationTableName = data.TableName,
BatchSize = _source.Count
};
var data = ToDataTable();
bulkCopyInterface.WriteToServerAsync(data, default).Wait();
}
return affrows;
@ -167,14 +167,14 @@ namespace FreeSql.ClickHouse.Curd
{
before = new Aop.CurdBeforeEventArgs(_table.Type, _table, Aop.CurdType.Insert, null, _params);
_orm.Aop.CurdBeforeHandler?.Invoke(this, before);
var data = ToDataTable();
using (var conn = await _orm.Ado.MasterPool.GetAsync())
{
using var bulkCopyInterface = new ClickHouseBulkCopy(conn.Value as ClickHouseConnection)
{
DestinationTableName = _table.DbName,
DestinationTableName = data.TableName,
BatchSize = _source.Count
};
var data = ToDataTable();
await bulkCopyInterface.WriteToServerAsync(data, default);
}
return affrows;