mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
测试Array常用查询函数
This commit is contained in:
@ -57,18 +57,7 @@ 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 = data.TableName,
|
||||
BatchSize = _source.Count
|
||||
})
|
||||
{
|
||||
bulkCopyInterface.WriteToServerAsync(data, default).Wait();
|
||||
}
|
||||
}
|
||||
InternalBulkCopyAsync().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||
return affrows;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -85,6 +74,24 @@ namespace FreeSql.ClickHouse.Curd
|
||||
return base.RawExecuteAffrows();
|
||||
}
|
||||
|
||||
internal async Task<int> InternalBulkCopyAsync()
|
||||
{
|
||||
var data = ToDataTable();
|
||||
using (var conn = _orm.Ado.MasterPool.Get())
|
||||
{
|
||||
using (var bulkCopyInterface = new ClickHouseBulkCopy(conn.Value as ClickHouseConnection)
|
||||
{
|
||||
DestinationTableName = data.TableName,
|
||||
BatchSize = _source.Count
|
||||
})
|
||||
{
|
||||
await bulkCopyInterface.WriteToServerAsync(data, default);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
private IDictionary<string, object> GetValue<T>(T u, System.Reflection.PropertyInfo[] columns)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user