🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

hapi-database

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-database

A Hapi plugin for the fabulous sequelize ORM

latest
Source
npmnpm
Version
1.0.9
Version published
Weekly downloads
5
-76.19%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-sequelize - a hapi plugin for the sequelize orm

Warning

This version of hapi-sequelize should be compatible with at least Hapi 13+ & Sequelize 3.x. If you're encountering an issue related to any specific version please open an issue. The rewrite of this plugin (3.x) has simplified things and made the plugin a bit more flexible.

Installation

npm install --save hapi-database

Configuration

Simply pass in your sequelize instance and a few basic options and voila. Options accepts a single object or an array for multiple dbs.

server.register([
  {
      register: require('hapi-database'),
      options: [ 
        {
          name: 'dbname', // identifier
          paths: ['./server/models/**/*.js'],  // paths/globs to model files
          connection: {
            uri: ''
          }, // sequelize instance
          sync: true, // sync models - default false
          forceSync: false, // force sync (drops tables) - default false
          onConnect: function (database) { // Optional
            // migrations, seeders, etc.
          }
        }
      ]
  }
]);

Keywords

sequelize

FAQs

Package last updated on 15 Aug 2017

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