ENH: refactor to_sql insert_data