Cross-database migration made easy. Last night I hacked a nice script in Go that is capable of migrating data from arbitrary queries to target tables.
This screen capture shows the script running on 46 tables in parallel.
Jobs are declarative and look like this:
”`go
jobJobLog := job{
TargetTable: "job_log",
SourceTable: "job_log",
TargetCols: []string{"id", "job_id", "ts", "code", "message", "payload"},
SourceQuery: "SELECT id, job_id, ts, code, message, payload FROM job_log",
}
”`
#Go #PostgreSQL #MySQL #SQL #database