https://github.com/chillerno1/node-red-contrib-mysql-config
Fork of node-red-contrib-stackhero-mysql that allows config to be set via environment variables.
https://github.com/chillerno1/node-red-contrib-mysql-config
mysql node-js node-red node-red-contrib
Last synced: 11 months ago
JSON representation
Fork of node-red-contrib-stackhero-mysql that allows config to be set via environment variables.
- Host: GitHub
- URL: https://github.com/chillerno1/node-red-contrib-mysql-config
- Owner: chillerno1
- Created: 2022-06-27T23:39:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-18T00:08:43.000Z (almost 4 years ago)
- Last Synced: 2024-12-16T03:51:01.325Z (over 1 year ago)
- Topics: mysql, node-js, node-red, node-red-contrib
- Language: HTML
- Homepage:
- Size: 42 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-red-contrib-mysql-config
[Node-RED](https://nodered.org) node to read and write to a MySQL or a MariaDB database.
## Foreword
**Note:** All credit for this work goes to the original creator(s): [https://github.com/stackhero-io/node-red-contrib-stackhero-mysql](https://github.com/stackhero-io/node-red-contrib-stackhero-mysql)
This is a fork for the purpose of configuring a connection using environment variables.
## Use Case
The primary use case for using this version is in instances where NodeRED changes are being deployed using CI/CD pipelines across multiple environments and credentials need to be configured using environment variables as opposed to manually setting them in the NodeRED UI.
## Configuration
In order to configure this node, set each of the inputs with it's environment variable name.

## Usage
This node is really simple.
Put your query in the `topic` variable and, if you have arguments, put them in an object in the `payload` variable.
You will get the result in the `payload` output variable.
Example:
```javascript
msg.topic = 'SELECT * FROM `users` WHERE `name` = :name AND `age` > :age;';
msg.payload = { name: 'Adrien', age: 30 };
return msg;
```
> Avoid SQL injections!!
>
> Do not NEVER EVER put variables content in `topic` directly!
> Always use the `payload` variable to pass your arguments.