File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Providers/FreeSql.Provider.ClickHouse/Curd Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,19 @@ protected override int RawExecuteAffrows()
7777 internal async Task < int > InternalBulkCopyAsync ( )
7878 {
7979 var data = ToDataTable ( ) ;
80+ var columns = new string [ _table . ColumnsByPosition . Length ] ;
81+ for ( var i = 0 ; i < columns . Length ; i ++ )
82+ {
83+ columns [ i ] = _table . ColumnsByPosition [ i ] . CsName ;
84+ }
8085 using ( var conn = _orm . Ado . MasterPool . Get ( ) )
8186 {
8287 using ( var bulkCopyInterface = new ClickHouseBulkCopy ( conn . Value as ClickHouseConnection )
8388 {
8489 DestinationTableName = data . TableName ,
85- BatchSize = _source . Count
86- } )
90+ BatchSize = _source . Count ,
91+ ColumnNames = columns
92+ } )
8793 {
8894 await bulkCopyInterface . InitAsync ( ) ;
8995 await bulkCopyInterface . WriteToServerAsync ( data , default ) ;
You can’t perform that action at this time.
0 commit comments