Inserting more than one record with the SQLITE nodes (standard/better)

GAZ082
Thu, 11 Sep 2025 13:01:13 +0000
General

Hey there. I’m using sqlite for storing my sensor’s readings. Had to create a string this way otherwise i was not able to load multiple records in one go. Heck, i was not able to use the placeholders either. Is there a more elegant way to insert multiple records?

msg.topic = insert into sensor_data (sensor_id, value, type) values (
+ msg.payload.sensor_id + ,+ msg.payload.temperature + ,1),(
+ msg.payload.sensor_id + ,+ msg.payload.humidity + ,2),(
+ msg.payload.sensor_id + ,+ msg.payload.battery + ,3)
return msg;

Thanks!

3 posts - 3 participants