Move handle_conflicts decorator into sql

Change-Id: I7ed923592e94f96be5226745224b981c3a3ac161
Merge "Move handle_conflicts decorator into sql"