How to avoid duplicate inserts with python library
The import from a csv with python and with using the import mariadb lib works with that code example very well:
cursor.execute("INSERT INTO connect_table (client, \ server,service) \ VALUES (?, ?, ?)", row)
Now I try to avoid duplicates with that method but it does not work.
cursor.execute("INSERT INTO connect_table (client, \ server,service) \ VALUES (?, ?, ?)", (row) \ "ON DUPLICATE KEY UPDATE client=" row[0], \ "server =" row[1], "service =" row[2])
How to prevent duplicates during import from csv files and with python?