feat: add type transformations (uuid, wkb, datetime)
Apply row-level transformations for special mssql types: uniqueidentifier, geometry/geography (WKB to EWKB) and datetime (UTC).
This commit is contained in:
@@ -4,9 +4,43 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type MigrationJob struct {
|
||||
Schema string
|
||||
Table string
|
||||
PrimaryKey string
|
||||
}
|
||||
|
||||
var migrationJobs []MigrationJob = []MigrationJob{
|
||||
{
|
||||
Schema: "demo",
|
||||
Table: "users",
|
||||
PrimaryKey: "id",
|
||||
},
|
||||
}
|
||||
|
||||
const (
|
||||
NumExtractors int = 2
|
||||
ChunkSize int = 20
|
||||
QueueSize int = 10
|
||||
)
|
||||
|
||||
func main() {
|
||||
configureLog()
|
||||
log.Info("Starting migration...")
|
||||
// log.Debugf("Migration jobs: %+v", migrationJobs)
|
||||
|
||||
sourceDb, targetDb, connError := connectToDatabases()
|
||||
if connError != nil {
|
||||
log.Fatal("Connection error: ", connError)
|
||||
}
|
||||
|
||||
defer sourceDb.Close()
|
||||
defer targetDb.Close()
|
||||
|
||||
for _, job := range migrationJobs {
|
||||
log.Infof("Processing job: %+v", job)
|
||||
processMigrationJob(sourceDb, targetDb, job)
|
||||
}
|
||||
|
||||
log.Info("Migration completed successfully!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user