[ WIP ] Adding ability to switch between insert & update

I think this is only needed for insert, so maybe move it into that branch?