1.0.9 • Published 8 years ago

hapi-database v1.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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.
          }
        }
      ]
  }
]);
1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago