Unnest with Reflection in Go

Recently at work I needed to write a utility to sync a PostgreSQL database
with another data source. In my attempts to make the synchronization
efficient, I came across a very helpful StackOverflow question which
explained how to perform bulk insertions and updates. The recommended
solution looked something like this: