Registry / database / botkit-storage-postgres

botkit-storage-postgres

JSON →
library0.1.0jsnpmunverified

A PostgreSQL storage driver for Botkit, version 0.1.0, enabling Botkit-powered chatbots to persist data (e.g., teams, users, channels) in a PostgreSQL database. It wraps the `pg` npm package and provides a simple configuration interface. The package has not been updated since 2017 and appears unmaintained. Compared to other Botkit storage backends (e.g., MongoDB, Redis), this one is minimal and lacks documentation for error handling or migrations.

npm install botkit-storage-postgres
INSTALL
IMPORT
SIG · BOTKIT-STORAGE-POS
B
botkit-storage-postgres
databasejavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const botkitStoragePostgres = require('botkit-storage-postgres');
import botkitStoragePostgres from 'botkit-storage-postgres';
This package uses CommonJS and does not support ESM imports.
botkitStoragePostgres (with options)
Botkit.slackbot({ storage: botkitStoragePostgres({ host: 'localhost', ... }) });
The function is called with a config object and returns a storage backend for Botkit.

Shows how to initialize Botkit with PostgreSQL storage using environment variables for credentials and a basic hello command.

const botkitStoragePostgres = require('botkit-storage-postgres'); const Botkit = require('botkit'); const controller = Botkit.slackbot({ storage: botkitStoragePostgres({ host: process.env.PGHOST ?? 'localhost', user: process.env.PGUSER ?? 'botkit', password: process.env.PGPASSWORD ?? 'botkit', database: process.env.PGDATABASE ?? 'botkit' }) }); controller.hears('hello', 'direct_message', function(bot, message) { bot.reply(message, 'Hello!'); });
Debug
Known issues
breakingThe package uses 'botkit-storage-mysql' in the README example but the package name is 'botkit-storage-postgres'.
fix
Replace 'require('botkit-storage-mysql')' with 'require('botkit-storage-postgres')'.
affects: 0.1.0
deprecatedPackage is no longer maintained and may not be compatible with newer versions of Botkit or Node.js.
fix
Consider using a fork or alternative storage driver that is actively maintained.
affects: >=0.1.0
gotchaThe package version (0.1.0) is a pre-release, implying unstable API and potential breaking changes in minor updates.
fix
Pin the exact version in package.json: "botkit-storage-postgres": "0.1.0"
affects: 0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'botkit-storage-mysql'
Copy-pasting the README example which incorrectly uses 'botkit-storage-mysql'.
fix
Replace 'require('botkit-storage-mysql')' with 'require('botkit-storage-postgres')'.
TypeError: botkitStoragePostgres is not a function
Attempting ESM import or using an older version that exports differently.
fix
Use CommonJS require() as shown in the README.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client library required for database operations
Agent activity
12 hits · last 30 days
node
8
OpenAI (training)
1
Resources
botkit-storage-postgres — npm install botkit-storage-postgres · libregistry