3.3.0 • Published 3 months ago

mikro-orm-cache-adapter-redis v3.3.0

Weekly downloads
99
License
MIT
Repository
github
Last release
3 months ago

Mikro-orm - Redis cache adapter

This is an adapter for redis to be used with mikro-orm.

Install it with its peer dependencies

npm i mikro-orm-cache-adapter-redis ioredis

and pass it as option to mikro-orm

import { MikroORM } from '@mikro-orm/core/MikroORM';
import { RedisCacheAdapter } from 'mikro-orm-cache-adapter-redis';

const orm = await MikroORM.init({
  // Your options
  resultCache: {
    adapter: RedisCacheAdapter,
    options: {
      // Base options
      // An optional key prefix. By default is `mikro`
      keyPrefix: 'mikro'
      // Optional: print debug informations
      debug: false,


      // Here goes IORedis connection options (the library will instantiate the client)
      host: '...',
      port: 6379,
      password: 'yourpassword'
    }
  }
});

Instead of passing options, you can pass directly an IORedis instance

import { RedisCacheAdapter } from "mikro-orm-cache-adapter-redis";
import Redis from "ioredis";

const myRedisClient = new Redis();

const orm = await MikroORM.init({
  // Your options
  resultCache: {
    adapter: RedisCacheAdapter,
    options: {
      client: myRedisClient,
    },
  },
});
3.3.0

3 months ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago