MySQL-backed datastore for use with Hubot
Clone or download
Latest commit ad12351 Jan 11, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
db Include database structure for reference Jan 11, 2019
.gitignore Initial import Jan 11, 2019 Initial import Jan 11, 2019 Add a README Jan 11, 2019
index.js Fix exports Jan 11, 2019
package-lock.json Add datastore-containing Hubot as a devDependency Jan 11, 2019
package.json Add datastore-containing Hubot as a devDependency Jan 11, 2019


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.


  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;

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


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


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