Skip to content

runnerty/notifier-db

Repository files navigation

Smart Processes Management

NPM version Downloads code style: prettier

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"
      }
    ]
  }
}

About

A notified for the insertion of records in database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published