I have used this code in my program:
def insert(self, table, params):
keys = ', '.join(params.keys())
values = params.values()
query = f"INSERT INTO songs ({keys}) VALUES (?, ?);"
print(keys)
print(query)
print(values)
self.cur.execute(query , values)
self.conn.commit()
return self.cur.lastrowid
Which prints
name, filehash
INSERT INTO songs (name, filehash) VALUES (?, ?);
dict_values(['testaudio8.mp3',
'BA614A989B7BCF44E38D00EEFFE96F2D8BD6677D'])
but returns the error:
self.cur.execute(query , values)
ValueError: parameters are of unsupported type
I want to insert the values from dict_values into the question marks but I get the error. Can anyone help please?