Fixed to save all ga attributes to config table in database

This commit is contained in:
SimpleArt
2020-11-16 15:55:47 -05:00
parent 2a1508468d
commit 3bf69b21a6
2 changed files with 6 additions and 41 deletions

View File

@ -124,7 +124,7 @@ class SQL_Database:
sql_create_config_structure = "CREATE TABLE IF NOT EXISTS config (\nid INTEGER PRIMARY KEY,"
sql_create_config_structure += "\n,".join(var_names)
sql_create_config_structure += "); "
self.create_table(ga.sql_create_config_structure)
self.create_table(sql_create_config_structure)
else:
print("Error! cannot create the database connection.")
@ -143,7 +143,11 @@ class SQL_Database:
db_config_list[i] = str(db_config_list[i])
# Create sql query structure
sql = "INSERT INTO config (" + ",\n".join(self.get_var_names(ga)) + ") VALUES(" + (",?"*len(db_config_list))[1:] + ") "
sql = "INSERT INTO config ("
sql += ",\n".join(self.get_var_names(ga))
sql += ") VALUES("
sql += ( ",?"*len(db_config_list) )[1:]
sql += ") "
# For some reason it has to be in var = array(tuple()) form
db_config_list = [tuple(db_config_list)]