Fixed bug
This commit is contained in:
@ -107,13 +107,13 @@ class SQL_Database:
|
|||||||
elif type(db_config_list[i]) not in self.sql_types:
|
elif type(db_config_list[i]) not in self.sql_types:
|
||||||
db_config_list[i] = str(db_config_list[i])
|
db_config_list[i] = str(db_config_list[i])
|
||||||
|
|
||||||
# For some reason it has to be in var = array(tuple()) form
|
|
||||||
db_config_list = [tuple(db_config_list)]
|
|
||||||
|
|
||||||
# Create sql query structure
|
# Create sql query structure
|
||||||
sql = f"""INSERT INTO config ({''',
|
sql = f"""INSERT INTO config ({''',
|
||||||
'''.join(ga.__dict__.keys())}) VALUES({(',?'*len(db_config_list))[1:]}) """
|
'''.join(ga.__dict__.keys())}) VALUES({(',?'*len(db_config_list))[1:]}) """
|
||||||
|
|
||||||
|
# For some reason it has to be in var = array(tuple()) form
|
||||||
|
db_config_list = [tuple(db_config_list)]
|
||||||
|
|
||||||
# Execute sql query
|
# Execute sql query
|
||||||
cur = self.conn.cursor()
|
cur = self.conn.cursor()
|
||||||
cur.executemany(sql, db_config_list)
|
cur.executemany(sql, db_config_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user