https://github.com/runnerty/notifier-db
A notified for the insertion of records in database
https://github.com/runnerty/notifier-db
Last synced: 12 months ago
JSON representation
A notified for the insertion of records in database
- Host: GitHub
- URL: https://github.com/runnerty/notifier-db
- Owner: runnerty
- License: mit
- Created: 2022-11-16T14:00:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T14:01:31.000Z (over 3 years ago)
- Last Synced: 2025-04-24T06:39:56.825Z (about 1 year ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Smart Processes Management
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]
A notified for the insertion of records in database [Runnerty]
### Installation:
Through NPM
```bash
npm i @runnerty/notifier-db
```
You can also add modules to your project with [runnerty]
```bash
npx runnerty add @runnerty/notifier-db
```
This command installs the module in your project, adds example configuration in your [config.json] and creates an example plan of use.
If you have installed [runnerty] globally you can include the module with this command:
```bash
runnerty add @runnerty/notifier-db
```
### Configuration sample:
Add in [config.json]:
```json
{
"notifiers": [
{
"id": "notifier_db_default",
"type": "@runnerty-notifier-db",
"user": "postgres",
"table": "rty.notifications",
"password": "my_password",
"database": "postgres",
"host": "my_host",
"port": "5432"
}
]
}
```
# Usage
You only have to indicate the "id" of the notified and the message you want to be inserted in the "message" column of the table indicated in the configuration.
```json
{
"notifications": {
"on_end": [
{
"id": "notifier_db_default",
"message": "Things done right."
}
]
}
}
```
In case you want to insert extra columns in addition to the "message" column you can indicate them in the "columns" property.
```json
{
"notifiers": [
{
"id": "notifier_db_default",
"type": "@runnerty-notifier-db",
"user": "postgres",
"table": "rty.notifications",
"password": "my_password",
"database": "postgres",
"host": "my_host",
"port": "5432",
"columns": ["message", "mode", "key"]
}
]
}
```
```json
{
"notifications": {
"on_end": [
{
"id": "notifier_db_default",
"key": "@GV(CHAIN_ID)",
"message": "Things done right.",
"mode": "info"
}
]
}
}
```
[Runnerty]: https://www.runnerty.io
[downloads-image]: https://img.shields.io/npm/dm/@runnerty/notifier-db.svg
[npm-url]: https://www.npmjs.com/package/@runnerty/notifier-db
[npm-image]: https://img.shields.io/npm/v/@runnerty/notifier-db.svg
[david-badge]: https://david-dm.org/runnerty/notifier-db.svg
[david-badge-url]: https://david-dm.org/runnerty/notifier-db
[config.json]: http://docs.runnerty.io/config/
[plan.json]: http://docs.runnerty.io/plan/