Build INSERT and UPSERT plans.