{"library":"node-red-contrib-stackhero-mysql","title":"Node-RED MySQL/MariaDB Connector","description":"node-red-contrib-stackhero-mysql is a Node-RED contribution that provides a robust node for interacting with MySQL and MariaDB databases. Currently at version 1.0.6, this package maintains a stable release cadence, focusing on reliability and compatibility. Its primary differentiator is native support for TLS (SSL) encryption for secure connections, along with compatibility for the \"Caching SHA2 password\" authentication method, which is crucial for modern MySQL 8.x environments. This addresses a common pain point for users connecting to newer MySQL instances. The node simplifies database operations within Node-RED flows by allowing SQL queries in `msg.topic` and parameterized arguments in `msg.payload`, supporting various parameter styles including object-based, named, positional, and bulk insertions. It integrates seamlessly into Node-RED, extending its capabilities for data persistence and retrieval without requiring custom code for connection handling or authentication specifics.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-red-contrib-stackhero-mysql"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"/*\nThis code would be placed in a Node-RED 'function' node.\nIt prepares the 'msg.topic' with an SQL query and 'msg.payload' with arguments.\nConnect this 'function' node's output to an 'Stackhero MySQL' node in your flow.\n*/\n\n// Example: Object-based insertion\nmsg.topic = 'INSERT INTO `users` SET ?';\nmsg.payload = { name: 'Adrien', age: 42 };\n\n// Example: Named parameters (uncomment to use)\n// msg.topic = 'INSERT INTO `users` (`name`, `age`) VALUES (:name, :age)';\n// msg.payload = { name: 'Romain', age: 12 };\n\n// Example: Positional parameters (uncomment to use)\n// msg.topic = 'INSERT INTO `users` (`name`, `age`) VALUES (?, ?)';\n// msg.payload = [ 'Eva', 28 ];\n\n// Example: Bulk (multi-row) insertion (uncomment to use)\n// msg.topic = 'INSERT INTO `users` (`name`, `age`) VALUES ?';\n// msg.payload = [[\n//   [ 'Alice', 30 ],\n//   [ 'Bob', 25 ]\n// ]];\n\nreturn msg;\n","lang":"javascript","description":"Demonstrates preparing `msg.topic` and `msg.payload` within a Node-RED function node for database interaction, showcasing various parameter passing methods.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}