Registry / database / databank-redis

databank-redis

JSON →
library0.19.6jsnpmunverified

Redis driver for the Databank key-value/document store abstraction library. Current version 0.19.6 (last released 2014, unmaintained). Provides a Redis-backed implementation of the Databank interface, storing objects as JSON strings with automatic indexing via Redis sets. Works with Node.js >=0.6.x. Limited to basic CRUD and set intersection queries; no support for Redis clustering, advanced data structures, or transactions.

npm install databank-redis
INSTALL
IMPORT
SIG · DATABANK-REDIS
D
databank-redis
databasejavascriptv0.19.6
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.

Databank
import { Databank } from 'databank'
const Databank = require('databank').Databank
ESM import of Databank class. The CommonJS pattern with .Databank property also works if using CJS.
databank-redis driver
import 'databank-redis'
const driver = require('databank-redis')
The driver is auto-registered with Databank on import. No named export; just import the module to activate.
Databank.get()
import { Databank } from 'databank'; import 'databank-redis'; const db = Databank.get('redis', { host: 'localhost', port: 6379 });
const db = require('databank-redis').get('redis', {});
The driver does not expose a get() method. Use Databank.get() after importing both packages.

Import Databank and the Redis driver, connect, perform CRUD operations on a person object.

import { Databank } from 'databank'; import 'databank-redis'; async function main() { const db = Databank.get('redis', { host: process.env.REDIS_HOST ?? '127.0.0.1', port: parseInt(process.env.REDIS_PORT ?? '6379', 10), database: 0 }); await db.connect(); // Save a person await db.save('person', 'evanp', { name: 'Evan', age: 30 }); // Read const person = await db.get('person', 'evanp'); console.log(person); // { name: 'Evan', age: 30 } // Search by index (requires schema) // const results = await db.search('person', { age: 30 }); await db.disconnect(); } main().catch(console.error);
Debug
Known issues
breakingThe driver only works with Databank v0.x. Databank v1+ has a different API and this driver is not compatible.
fix
Use databank v0.x, or migrate to a different abstraction library.
affects: >=0.19.6
deprecatedThis package has not been updated since 2014. It may have security issues and does not support modern Redis features.
fix
Consider using ioredis or redis-om for a maintained solution.
affects: >=0.0.0
gotchaIndices are built on connect if checkIndices is true (default). This can be extremely slow on large datasets and may cause timeouts.
fix
Set `checkIndices: false` in options if you do not need automatic index sync.
affects: >=0.0.0
gotchaObjects and arrays are stored as JSON strings. Numbers are stored as Redis numbers, but type coercion may lead to unexpected results.
fix
Ensure numeric values are actually numbers, not strings, before saving.
affects: >=0.0.0
gotchaThe database parameter accepts an integer Redis database index (0-15 by default). Using a non-integer or out-of-range value may cause a connection error.
fix
Provide a valid integer between 0 and 15 (or configured max).
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'databank'
Missing required peer dependency 'databank'.
fix
npm install databank
Databank.get is not a function
Incorrect import of databank (default vs named).
fix
Change to: const { Databank } = require('databank'); or import { Databank } from 'databank';
Redis connection refused 127.0.0.1:6379
Redis server not running or host/port incorrect.
fix
Start Redis server or provide correct host/port in options.
Upgrade
Version history
0.19.6latest on npm
Audit
Dependencies
databankrequiredCore Databank interface required for driver to function
redisrequiredRedis client library (likely node_redis)
Agent activity
10 hits · last 30 days
node
8
Resources
databank-redis — npm install databank-redis · libregistry