I have an application that inserts (or replaces) records with a unique key into a SQLite database table. It is expected to do about 1500 records per second but it's slower than this due to performance issues.
Currently I'm doing it as such (in Python):
for item in items:
CONN.execute("INSERT OR REPLACE INTO ITEMS (ITEM_ID) VALUES ("+item['itemId']+")")
What I would like is a bulk insert or replace to improve performance.
I know there is a way to do bulk inserts: Is it possible to insert multiple rows at a time in an SQLite database?
But is there a way to do bulk insert or replace? I know that insert or replace is NOT the same as upsert - that's OK.