feat: implement data generation and loading for MANZANA with improved structure and logging
This commit is contained in:
@@ -242,6 +242,10 @@ ORDER BY c.column_id;
|
||||
return nil, fmt.Errorf("Error scanning column type results: %W", err)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(column.name, "graph_id") && column.systemType == "bigint" {
|
||||
continue
|
||||
}
|
||||
|
||||
colTypes = append(colTypes, MapMssqlColumn(column))
|
||||
}
|
||||
|
||||
|
||||
@@ -13,5 +13,5 @@ func configureLog() {
|
||||
DisableSorting: false,
|
||||
PadLevelText: true,
|
||||
})
|
||||
log.SetLevel(log.InfoLevel)
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type MigrationJob struct {
|
||||
|
||||
var migrationJobs []MigrationJob = []MigrationJob{
|
||||
{
|
||||
Schema: "Cartografia",
|
||||
Table: "MANZANA",
|
||||
PrimaryKey: "GDB_ARCHIVE_OID",
|
||||
Schema: "Red",
|
||||
Table: "PUERTO",
|
||||
PrimaryKey: "ID_PUERTO",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -79,16 +79,17 @@ func processMigrationJob(sourceDb *sql.DB, targetDb *pgxpool.Pool, job Migration
|
||||
}()
|
||||
|
||||
var wgPostgresLoaders sync.WaitGroup
|
||||
postgresLoaderCtx := context.Background()
|
||||
// postgresLoaderCtx := context.Background()
|
||||
|
||||
log.Infof("Starting %d PostgreSQL loader(s)...", NumLoaders)
|
||||
loaderStartTime := time.Now()
|
||||
|
||||
for range NumLoaders {
|
||||
wgPostgresLoaders.Go(func() {
|
||||
if err := loadRowsPostgres(postgresLoaderCtx, job, sourceColTypes, targetDb, chRowsTransform); err != nil {
|
||||
log.Error("Unexpected error loading data into postgres: ", err)
|
||||
}
|
||||
// if err := loadRowsPostgres(postgresLoaderCtx, job, sourceColTypes, targetDb, chRowsTransform); err != nil {
|
||||
// log.Error("Unexpected error loading data into postgres: ", err)
|
||||
// }
|
||||
fakeLoader(job, sourceColTypes, chRowsTransform)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user