feat: refactor data extraction and loading functions for improved context handling

This commit is contained in:
2026-04-07 12:55:05 -05:00
parent 6da321c4bb
commit 7bb67ddfcf
5 changed files with 55 additions and 28 deletions

View File

@@ -9,7 +9,7 @@ import (
log "github.com/sirupsen/logrus"
)
type UnknownRowValues []any
type UnknownRowValues = []any
func extractFromMssql(ctx context.Context, job MigrationJob, columns []ColumnType, chunkSize int, db *sql.DB, out chan<- []UnknownRowValues) error {
query := buildExtractQueryMssql(job, columns)
@@ -40,13 +40,13 @@ func extractFromMssql(ctx context.Context, job MigrationJob, columns []ColumnTyp
if len(rowsChunk) >= chunkSize {
out <- rowsChunk
rowsChunk = make([]UnknownRowValues, 0, chunkSize)
log.Infof("Chunk send... %+v", job)
log.Debugf("Chunk send... %+v", job)
}
}
if len(rowsChunk) > 0 {
out <- rowsChunk
log.Infof("Chunk send... %+v", job)
log.Debugf("Chunk send... %+v", job)
}
return nil