mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-06 16:30:52 +08:00
Merge pull request #2106 from Im-Kevin/master
将ClickHouse的驱动从ClickHouse.Client改成ClickHouse.Driver
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using ClickHouse.Client.ADO;
|
||||
using ClickHouse.Driver.ADO;
|
||||
using FreeSql.Internal;
|
||||
using FreeSql.Internal.CommonProvider;
|
||||
using FreeSql.Internal.Model;
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using ClickHouse.Client.ADO;
|
||||
using ClickHouse.Driver.ADO;
|
||||
|
||||
namespace FreeSql.ClickHouse
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Data.Common;
|
||||
using System.Reflection;
|
||||
using FreeSql.Internal.ObjectPool;
|
||||
using ClickHouse.Client.ADO;
|
||||
using ClickHouse.Driver.ADO;
|
||||
using FreeSql.DataAnnotations;
|
||||
|
||||
namespace FreeSql.ClickHouse
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using ClickHouse.Client.ADO;
|
||||
using ClickHouse.Driver.ADO;
|
||||
|
||||
namespace FreeSql.ClickHouse
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using FreeSql.Internal;
|
||||
using FreeSql.Internal.Model;
|
||||
using ClickHouse.Client.ADO;
|
||||
using ClickHouse.Driver.ADO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Globalization;
|
||||
using System.Data;
|
||||
using System.Text.Json;
|
||||
using ClickHouse.Client.ADO.Parameters;
|
||||
using ClickHouse.Driver.ADO.Parameters;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using ClickHouse.Client.ADO;
|
||||
using ClickHouse.Client.Copy;
|
||||
using ClickHouse.Driver.ADO;
|
||||
using ClickHouse.Driver.Copy;
|
||||
using FreeSql.Internal;
|
||||
using FreeSql.Internal.Model;
|
||||
using System;
|
||||
@@ -77,13 +77,19 @@ namespace FreeSql.ClickHouse.Curd
|
||||
internal async Task<int> InternalBulkCopyAsync()
|
||||
{
|
||||
var data = ToDataTable();
|
||||
var columns = new string[_table.ColumnsByPosition.Length];
|
||||
for ( var i = 0; i < columns.Length; i++ )
|
||||
{
|
||||
columns[i] = _table.ColumnsByPosition[i].CsName;
|
||||
}
|
||||
using (var conn = _orm.Ado.MasterPool.Get())
|
||||
{
|
||||
using (var bulkCopyInterface = new ClickHouseBulkCopy(conn.Value as ClickHouseConnection)
|
||||
{
|
||||
DestinationTableName = data.TableName,
|
||||
BatchSize = _source.Count
|
||||
})
|
||||
BatchSize = _source.Count,
|
||||
ColumnNames =columns
|
||||
})
|
||||
{
|
||||
await bulkCopyInterface.InitAsync();
|
||||
await bulkCopyInterface.WriteToServerAsync(data, default);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ClickHouse.Client" Version="7.13.2" />
|
||||
<PackageReference Include="ClickHouse.Driver" Version="0.7.20" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user