fastify-sequelizer

1.1.1 • Public • Published

fastify-sequelizer

Fastify sequelize connection plugin

Install

npm i -S fastify-sequelizer

Register plugin

const database = {
  // db url
  url: 'postgres://user:password@localhost:5432/my-db',
  // sequelize options
  options: {
    logging: true
  }
};

// logs for this super plugin
const log = {
  connection: {
    success: 'my super db is ready',
    error: 'error in my super db'
  },
  closure: {
    success: 'my super db is disconnected',
    error: 'my super db is not disconnected'
  }
};

fastify.register(require('fastify-sequelizer'), { database, logs });

Usage

fastify.sequelize

// or
fastify.Sequelize

Package Sidebar

Install

npm i fastify-sequelizer

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

4.34 kB

Total Files

7

Last publish

Collaborators

  • gamador