SQLite
由于 SQLite 兼容性,你需要sqlite3@^4.0.0
. 像这样配置 Sequelize:
const sequelize = new Sequelize('database', 'username', 'password', {
// sqlite!
dialect: 'sqlite',
// sqlite 的存储引擎
// - default ':memory:'
storage: 'path/to/database.sqlite'
})
或者你也可以使用连接字符串和路径:
const sequelize = new Sequelize('sqlite:/home/abs/path/dbname.db')
const sequelize = new Sequelize('sqlite:relativePath/dbname.db')