The purpose of this guide is to provide guidance on building applications using Sequelize by showing tips and tricks about it. All examples were made using AdventureWorks database.
Official documentation! Complementary documentation!
- Setup
- Structure
- Mappings and Configurations
- Migrations
- Queries
- Write Operations
- Tests
-
Dowloading SQL Server Adventure Works database - https://www.microsoft.com/en-us/download/details.aspx?id=49502
-
Loggin
You can enable/disable or customize sequelize logs using property logging
in the sequelize configuration:
const sequelize = new Sequelize('AdventureWorks2016CTP3', 'my-user', 'my-password', {
...
logging: false // or true or console.log (or another log app)
...
});
- Fixing de "sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security" message.
To fix this message you need to set the operatorsAliases
in the sequelize configuration properties with false
or Sequelize.Op
:
const sequelize = new Sequelize('AdventureWorks2016CTP3', 'my-user', 'my-password', {
...
operatorsAliases: false, // Sequelize.Op
...
});
See more at: http://docs.sequelizejs.com/manual/tutorial/querying.html#operators