🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

catbox-sequelize

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

catbox-sequelize

Sequelize adapter for catbox

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

catbox-sequelize

Sequelize adapter for catbox

Options

The connection can be specified with one (and only one) of:

  • sequelize - a custom Sequelize client instance where sequelize must:

    • be manually started and stopped,
    • manually synced
    • not already synced
  • url - a Sequelize server URL.

catbox options:

  • partition - the table used for the cache. Defaults to catbox.

Usage

Sample catbox cache initialization:

const Catbox = require('@hapi/catbox')
const CatboxSequelize = require('catbox-sequelize')


const cache = new Catbox.Client(CatboxRedis, {
  partition : 'my_catbox_cache'
  url: 'postgres://user:pass@example.com:5432/dbname'
})

When used in a hapi server (hapi version 18 or newer):

const Hapi = require('hapi')
const CatboxSequelize = require('catbox-sequelize')

const server = new Hapi.Server({
  cache: [
    {
      name: 'my_cache',
      provider: {
        constructor: CatboxSequelize,
        url: 'postgres://user:pass@example.com:5432/dbname'
      }
    }
  ]
})

Tests

The test suite expects a postgresql server on the standart port with a database named catbox owned by a user catbox with the password catbox

To set it up locally, run npm run db

Keywords

cache

FAQs

Package last updated on 19 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts