@@ -34,10 +34,10 @@ export interface SqlReadQueryInfo {
34
34
}
35
35
36
36
export interface SqlSaveOptions {
37
- chunkSize ?: number ;
38
- primaryKeys : string [ ] ;
39
37
method : "Merge" | "Append" | "BulkInsert" ;
40
- batchProgressFunc ?: ( status : SqlSaveStatus ) => void ;
38
+ batchSize ?: number ;
39
+ primaryKeys ?: string [ ] ;
40
+ batchProgressFunc ?: ( processedCount : number , status : SqlSaveStatus ) => void ;
41
41
}
42
42
43
43
export function setBaseUrl ( baseUrl : string ) : void {
@@ -488,7 +488,7 @@ export class SqlDataApi {
488
488
saveOptions ?: SqlSaveOptions
489
489
) : Promise < SqlSaveStatus > {
490
490
const maxTableSize = 1500000 ;
491
- const maxRowsCount = saveOptions ?. chunkSize || 10000 ;
491
+ const maxRowsCount = saveOptions ?. batchSize || 10000 ;
492
492
const primaryKeys = saveOptions ?. primaryKeys || undefined ;
493
493
const batchSavedFunc = saveOptions ?. batchProgressFunc ;
494
494
const saveMethod =
@@ -571,7 +571,7 @@ export class SqlDataApi {
571
571
} ) ) as SqlSaveStatus ;
572
572
573
573
if ( typeof batchSavedFunc === "function" ) {
574
- batchSavedFunc ( singleStatus ) ;
574
+ batchSavedFunc ( currentIndex + 1 , singleStatus ) ;
575
575
}
576
576
577
577
status . inserted += singleStatus . inserted ;
@@ -605,7 +605,7 @@ export class SqlDataApi {
605
605
}
606
606
}
607
607
608
- export function dbTypeConverter ( ) {
608
+ export function dbTypeConverter ( ) : DbTypeConverter {
609
609
return new DbTypeConverter ( ) ;
610
610
}
611
611
0 commit comments