官网地址:Sequelize Sequelize is a promise-based ORM for Node.js v4 and up. It supports the dialects PostgreSQL, MySQL, SQLite and MSSQL and features solid transaction support, relations, read replication and more. ORM: 对象关系映射(Object Relational Mapping,简称
最近刚开始接触Sequelize,当中遇到不少坑,所以想写篇Sequelize入门和大家分享,避免有道友和我一样爬坑. 学习sequelize的初衷是想解决SQL注入,它支持MySQL, SQLite, MariaDB and MSSQL,文中以MySQL举例. 第一步:实例化sequelize数据库连接 var Sequelize = require('sequelize'); var sequelize = new Sequelize('database','user','password'