@runnerty/notifier-db
v3.0.0
Published
Runnerty module: db notifier
Downloads
2
Maintainers
Readme
A notified for the insertion of records in database Runnerty
Installation:
Through NPM
npm i @runnerty/notifier-db
You can also add modules to your project with runnerty
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:
runnerty add @runnerty/notifier-db
Configuration sample:
Add in config.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.
{
"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.
{
"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"]
}
]
}
{
"notifications": {
"on_end": [
{
"id": "notifier_db_default",
"key": "@GV(CHAIN_ID)",
"message": "Things done right.",
"mode": "info"
}
]
}
}