diff --git a/crosstab/crosstab.py b/crosstab/crosstab.py index 7a7cbac..a6d07c4 100644 --- a/crosstab/crosstab.py +++ b/crosstab/crosstab.py @@ -243,8 +243,9 @@ def _csv_to_sqlite(self: Crosstab) -> sqlite3.Connection: logger.debug("Creating 'data' table in SQLite database.") with conn: cursor = conn.cursor() + coldef = ", ".join([f'"{col}"' for col in self.csv_columns]) cursor.execute( - f"CREATE TABLE data ({', '.join([f'"{col}"' for col in self.csv_columns])});", + f"CREATE TABLE data ({coldef});", ) cursor.executemany( f"INSERT INTO data VALUES ({', '.join(['?' for _ in self.csv_columns])});",