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:
2026-04-08 11:00:00 -05:00
parent 92f010a9a6
commit c5987fa7f8
8 changed files with 745 additions and 0 deletions

View File

@@ -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!")
}