Fix import csv failing when single quote is in string

This commit is contained in:
psvri
2025-01-05 17:34:56 +05:30
parent 3bc86a3cfc
commit ce8600a695
3 changed files with 5 additions and 4 deletions

View File

@@ -81,7 +81,8 @@ impl<'a> ImportFile<'a> {
for r in record.iter() {
values_string.push('\'');
values_string.push_str(r);
// The string can have a single quote which needs to be escaped
values_string.push_str(&r.replace("'", "''"));
values_string.push_str("',");
}