louis's Blog

louis's Avatar Image
Software developer #Go #CommonLisp #JS #SQL. #LispWorks user. Soft spots for #Emacs #SmallWeb. Recently becoming #OpenBSD enthusiast.

Other hobbies: #Running #FireFighter #StarTrek
← All posts

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

To like or reply, open original post on Emacs.ch