this change is related to my patch and includes the SQL for the upsert.