{"library":"node-red-node-sqlite","title":"node-red-node-sqlite","description":"Node-RED node for local SQLite database read/write operations. Current stable version is 2.0.1, released as part of the node-red-nodes collection. The package wraps the better-sqlite3 library (v2+) or sqlite3 (v1) to provide SQL query execution with support for prepared statements, parameterized queries, batch execution, SQLite extensions, and configurable reconnect timeouts. Install via npm in the Node-RED user directory with --unsafe-perm flag. Version 2.x introduces a breaking change requiring native binary rebuild on some platforms. Allows SQL injection when using raw queries via msg.topic, but prepared statements mitigate this.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install node-red-node-sqlite"],"cli":null},"imports":["nodes are loaded automatically by Node-RED after npm install; no manual import required","configure via Node-RED editor under 'storage' category","set msg.topic to SQL query string, msg.payload for parameters"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Assuming Node-RED flow environment.\n// 1. Install: npm i --unsafe-perm node-red-node-sqlite\n// 2. Restart Node-RED.\n// 3. Add an inject node and a sqlite node to the canvas.\n// 4. Configure sqlite node: enter database path (e.g., /data/test.db).\n// 5. Set SQL Query: \"Via msg.topic\"\n// 6. Set SQL Statement: SELECT * FROM users WHERE name = $name\n// 7. In inject node, set:\n//    msg.topic = \"SELECT * FROM users WHERE name = $name\"\n//    msg.payload = [\"John\"]\n//    msg.params = { $name: \"John\" }   // if using prepared statement\n// 8. Deploy and inject. Output returns rows in msg.payload.\n// For batch: msg.topic = \"INSERT INTO logs VALUES('test'); INSERT INTO logs VALUES('test2');\"\n// Return in msg.payload: array of row objects or success/error status.","lang":"javascript","description":"Shows basic SQLite node usage: install, configure, inject query via msg.topic with parameters, and retrieve results.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}