fastify-sequelize
Fastity plugin work with Sequelize (adapter for NodeJS -> Sqlite, Mysql, Mssql, Posgres)
install
npm install fastify-sequelize
Usage
const fastify = const fsequelize = const sequelizeConfig = instance: 'sequelize' // the name of fastify plugin instance. autoConnect: true // auto authentication and test connection on first run // other sequelize config goes here dialect: 'sqlite' // SQLite only storage: 'path/to/db.sqlite' fastify fastify
instance
: (optional) the name of instance will be mapped to fastify, default issequelize
autoConnect
:default: true
auto authentication and test connection on first run.sequelizeConfig
: all sequelize configurations, you can see here.