Skip to content

Commit

Permalink
added IF NOT EXISTS to toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jpulidojr committed Sep 16, 2024
1 parent 90fb797 commit e78f7aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dsi/backends/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ def tomlToSqlite(self, filenames, db_name, deleteSql=True):
data_types = {float: "FLOAT", str: "VARCHAR", int: "INT"}

if not os.path.isfile(db_name+".db") or os.path.getsize(db_name+".db") == 0:
createStmt = f"CREATE TABLE {tableName} ( "
createUnitStmt = f"CREATE TABLE {tableName}_units ( "
createStmt = f"CREATE TABLE IF NOT EXISTS {tableName} ( "
createUnitStmt = f"CREATE TABLE IF NOT EXISTS {tableName}_units ( "
insertUnitStmt = f"INSERT INTO {tableName}_units VALUES( "

for key, val in tableData.items():
Expand Down

0 comments on commit e78f7aa

Please sign in to comment.