MySQL-backed datastore for use with Hubot
Перейти к файлу
dependabot[bot] b99803dd83
Bump the npm_and_yarn group with 2 updates (#10)
Bumps the npm_and_yarn group with 2 updates: [cookie](https://github.com/jshttp/cookie) and [express](https://github.com/expressjs/express).


Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1)

Updates `express` from 4.21.0 to 4.21.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.0...4.21.1)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: express
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-23 12:39:53 +02:00
db Include database structure for reference 2019-01-11 16:27:10 +11:00
.gitignore Initial import 2019-01-11 15:43:58 +11:00
LICENSE.md Initial import 2019-01-11 15:43:58 +11:00
README.md feat: support custom port (#1) 2022-06-02 15:04:30 +03:00
index.js feat: support custom port (#1) 2022-06-02 15:04:30 +03:00
package-lock.json Bump the npm_and_yarn group with 2 updates (#10) 2024-10-23 12:39:53 +02:00
package.json chore: bump deps (#3) 2023-08-29 12:46:07 +03:00

README.md

hubot-mysql-datastore

This module provides an implementation of Hubot's datastore backed by MySQL. Hubot's datastore provides a persistent, database-backed key-value store; for more information, see Hubot's documentation.

Installation

  1. Add hubot-mysql-datastore to your Hubot's package.json.
  2. Create a database; the required structure can be found in the sample SQL schema.
  3. Create a script, loaded early in Hubot's startup, which initializes this class and assigns it to robot.datastore. For example, your scripts/0-mysql-datastore.js might look like this:
const MysqlDataStore = require('hubot-mysql-datastore')

module.exports = (robot) => {
  let host = process.env.HUBOT_DATASTORE_HOST;
  let user = process.env.HUBOT_DATASTORE_USER;
  let password = process.env.HUBOT_DATASTORE_PASSWORD;
  let database = process.env.HUBOT_DATASTORE_DATABASE;
  let port = process.env.HUBOT_DATASTORE_PORT; // optional

  robot.datastore = new MysqlDataStore(host, user, password, database, "utf8mb4", port);
}

Support

If you need any help with this package, please open an issue and provide as much relevant information as you can.

Maintainer

hubot-mysql-datastore's primary author is @mistydemeo.