Oliver Schröder
08/22/2024, 11:39 AMCREATE TABLE MQTT(topic TEXT PRIMARY KEY, value TEST);
upsertMQTTValue:
INSERT INTO MQTT(topic, value) VALUES(?,?)
ON CONFLICT(topic) DO UPDATE SET value=excluded.value
However, when I run the program, the following issue occurs:
(1) ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint in [...]
I basically copied the instruction from the SQLite documentation, as far as I understand it should work - any ideas why it doesn't?griffio
08/22/2024, 1:02 PMMQTT
table was not created with a primary key e.g CREATE TABLE MQTT(topic TEXT, value TEST);
as that would cause the error - double check that your sqlite database does indeed have your latest schema as the error is raised when the insert is made.