onyxfish/csvkit — pull request #126 by migonzalvar (2011-10-09 22:06:49+00:00)
Title: Choose what quotes to use in the insert feature to avoid the need to escape

Instead of escape quotes in insert statement generation it tries to use double quotes when single quote are present in the value.

It adds 2 tests with strings containing ' and " and another one to check ASCII extended characters conversion.

Finally, I also changed in test_sql.py make_insert_statement(self) to test_make_insert_statement(self) and fix a method call from _prepare_rows_for_serialization() to to_rows(serialize_dates=True).

I know this is not a fully database specific solution (see #86) but IMHO I think it's better than current situation. At least it works, for me :-).