File tree Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 1- - ADO.NET: Added ` BulkUpsertAsync ` for batch upsert operations with transaction checks and integration tests.
1+ - ADO.NET: Added ` BeginBulkUpsertImport ` for batch upsert operations with transaction checks and integration tests.
22- Optimization: On BadSession, do not invoke the ` DeleteSession() ` method.
33- Canceling AttachStream after calling the ` DeleteSession ` method.
44- Fixed bug: fixed issue where session was not deleted (` ClientTransportTimeout ` ).
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public sealed class BulkUpsertImporter : IBulkUpsertImporter
1515 private readonly RepeatedField < Ydb . Value > _rows = new ( ) ;
1616 private readonly CancellationToken _cancellationToken ;
1717 private StructType ? _structType ;
18- private int _currentBytes = 0 ;
18+ private int _currentBytes ;
1919
2020 public BulkUpsertImporter (
2121 IDriver driver ,
@@ -38,8 +38,7 @@ public async ValueTask AddRowAsync(object?[] values)
3838 throw new ArgumentException ( "Values count must match columns count" , nameof ( values ) ) ;
3939
4040 var ydbValues = values . Select ( v =>
41- v as YdbValue ?? ( v is YdbParameter param ? param . YdbValue :
42- new YdbParameter { Value = v } . YdbValue )
41+ v as YdbValue ?? ( v is YdbParameter param ? param . YdbValue : new YdbParameter { Value = v } . YdbValue )
4342 ) . ToArray ( ) ;
4443
4544 var protoStruct = new Ydb . Value ( ) ;
@@ -96,4 +95,4 @@ public async ValueTask FlushAsync(CancellationToken cancellationToken = default)
9695 _rows . Clear ( ) ;
9796 _currentBytes = 0 ;
9897 }
99- }
98+ }
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ public interface IBulkUpsertImporter
44{
55 ValueTask AddRowAsync ( object ? [ ] rows ) ;
66 ValueTask FlushAsync ( CancellationToken cancellationToken = default ) ;
7- }
7+ }
Original file line number Diff line number Diff line change @@ -489,9 +489,6 @@ public async Task BulkUpsertImporter_ThrowsOnNonexistentTable()
489489
490490 await importer . AddRowAsync ( [ YdbValue . MakeInt32 ( 1 ) , YdbValue . MakeUtf8 ( "NotExists" ) ] ) ;
491491
492- await Assert . ThrowsAsync < YdbException > ( async ( ) =>
493- {
494- await importer . FlushAsync ( ) ;
495- } ) ;
492+ await Assert . ThrowsAsync < YdbException > ( async ( ) => { await importer . FlushAsync ( ) ; } ) ;
496493 }
497494}
You can’t perform that action at this time.
0 commit comments