import Sequelize from 'sequelize'
new Sequelize('sqlite://a.db/hello')
It works. while
$ seqeulize --url sqlite://a.db/hello db:migrate
Got error
Unable to connect to database: SequelizeConnectionError: SQLITE_CANTOPEN: unable to open database file
For, it tries to open /hello file, and the config parsed by sequelize-cli is
{ database: 'hello,
dialect: 'sqlite',
host: 'a.db',
port: null,
storage: '/hello' }
The related code is located at https://github.com/sequelize/cli/blob/master/lib/helpers/config-helper.js#L176 and https://github.com/sequelize/sequelize/blob/master/lib/dialects/sqlite/connection-manager.js#L62
In my case, following works fine.
//config.js
module.exports = {
"development": {
"storage": "./server/dev_db.sqlite",
"dialect": "sqlite"
},
"test": {
"storage": "./server/test_db.sqlite",
"dialect": "sqlite"
},
"production": {
"storage": "./server/prod_db.sqlite",
"dialect": "sqlite"
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.