Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

修复ClickHouse会报Column names not initialized的错误 #2129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2881099 merged 2 commits into dotnetcore:master from Im-Kevin:master
Oct 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Providers/FreeSql.Provider.ClickHouse/Curd/ClickHouseInsert.cs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,21 @@ async protected override Task<int> RawExecuteAffrowsAsync(CancellationToken canc
before = new Aop.CurdBeforeEventArgs(_table.Type, _table, Aop.CurdType.Insert, null, _params);
_orm.Aop.CurdBeforeHandler?.Invoke(this, before);
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 = await _orm.Ado.MasterPool.GetAsync())
{
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);
}
}
Expand All @@ -201,7 +208,7 @@ async protected override Task<int> RawExecuteAffrowsAsync(CancellationToken canc
catch (Exception ex)
{
exception = ex;
throw ex;
throw;
}
finally
{
Expand Down

AltStyle によって変換されたページ (->オリジナル) /