sequelize-transparent-cache-variable

2.2.3 • Public • Published

sequelize-transparent-cache-variable

Variable adaptor for sequelize-transparent-cache.

Stores sequelize objects in variable. Useful for debugging purposes.

Warning: Do not use this adaptor in production, unless you know what you doing.

Example usage

const VariableAdaptor = require('sequelize-transparent-cache-variable')
const variableAdaptor = new VariableAdaptor({
  store: {} // optional
})

Constructor arguments

Param Type Required Description
store object no Object to store sequelize instances

Storing format

Each object stored as is, keyed by id (Primary Key).

adaptor.set(['modelName', 'objectId']);

store structure:

{
  "modelName": {
    "objectId": {...}
  }
}

If object has multiple primary keys, object will be stored as is, keyed by concatenated Ids separated by comma.

adaptor.set(['modelName', 'objectId1', 'objectId2']);

store structure will be:

{
  "modelName": {
    "objectId1,objectId2": {...}
  }
}

For more info see sequelize-transparent-cache

Package Sidebar

Install

npm i sequelize-transparent-cache-variable

Weekly Downloads

75

Version

2.2.3

License

CC-BY-4.0

Unpacked Size

2.6 kB

Total Files

4

Last publish

Collaborators

  • daniel.hreben