From 7505b0a9908672c2a673e4b15f931172adeede2d Mon Sep 17 00:00:00 2001 From: phga Date: Wed, 20 Oct 2021 18:44:50 +0200 Subject: [PATCH] fix: table cols in double quotes --- melli/excel2sql.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/melli/excel2sql.py b/melli/excel2sql.py index b170497..a81f332 100755 --- a/melli/excel2sql.py +++ b/melli/excel2sql.py @@ -53,11 +53,11 @@ with open(out_file_path, "w") as of: vals = "" for i in range(len(indices)): if i != 0: - cols += f", {indices[i]}" - vals += f", {wrap_types(values[i])}" + cols += f', "{indices[i]}"' + vals += f', {wrap_types(values[i])}' else: - cols += f"{indices[i]}" - vals += f"{wrap_types(values[i])}" + cols += f'"{indices[i]}"' + vals += f'{wrap_types(values[i])}' # INSERT INTO $DB.$TABLE ($COL1, $COL2, ...) VALUES ($VAL1, $VAL2, ...) of.write(f'INSERT INTO {db_table} ({cols}) VALUES ({vals})\n') count += 1