redbase icon indicating copy to clipboard operation
redbase copied to clipboard

Reuse redis connection

Open chronark opened this issue 2 years ago • 0 comments

Currently each "table" or "collection" creates a new redis connection pool.

import { Redbase } from 'redbase'

// Can use strings, numbers or buffers as well
type MyValue = {
  // ..
}
const db = new Redbase<MyValue>('myProject', { redisUrl: 'redis://...' })

it would be great if redbase would maintain a single connection pool instead.

for example:

import { Redbase } from 'redbase'

const red = new Redbase({ redisUrl: "redis://..." })

const users = red.newCollection<User>("users")

chronark avatar Mar 22 '23 14:03 chronark