@skweb/plugin-sequelize
v1.0.0
Published
Sequelize database plugin for @skweb/framework
Downloads
14
Maintainers
Readme
@skweb/plugin-sequelize
Sequelize database plugin for @skweb/framework. Injects a Database instance
into the framework via ctx.framework.setDb() during the beforeSetup phase.
Installation
npm install @skweb/plugin-sequelize @skweb/framework @skweb/sequelizeUsage
import { WebFramework } from '@skweb/framework'
import { SequelizePlugin } from '@skweb/plugin-sequelize'
import { createExpressApp } from '@skweb/express'
const framework = new WebFramework({
runtimeFactory: createExpressApp
})
framework.usePlugin(new SequelizePlugin({
dialect: 'mysql',
host: '127.0.0.1',
port: 3306,
username: 'root',
password: '',
database: 'my-app',
logging: process.env.DEBUG_DB === 'true'
}))
// framework.setup() will now create the Database instance and sync modelsLicense
MIT
