I'm using the following, protocol-less, code to set up a Sequelize 1.7.10 instance using sqlite3 2.2.7:
var Sequelize = require("sequelize");
var sequelize = new Sequelize("inkcyclopedia", {
dialect: "sqlite",
storage: "inkcyclopedia.sqlite"
});
But running this code generates the following error:
options.dialect = urlParts.protocol.replace(/:$/, '')
^
TypeError: Cannot call method 'replace' of null
Which makes sense, because I never specified a protocol, so it defaults to null. Pretty sure this should not cause a problem, as there is no username/password requirement for sqlite files, yet it throws an error.
Looks like it's interpreting the database as a connection URI, try doing new Sequelize("inkcyclopedia", null, null, {})
looks like it; with null username/pass the connection gets set up correctly.
This fix works! Thanks. Might I suggest adding it as an example here in the documentation: http://sequelize.readthedocs.io/en/latest/api/sequelize/ There is no SQLite3 example currently, so this would certainly help things.
Most helpful comment
Looks like it's interpreting the database as a connection URI, try doing
new Sequelize("inkcyclopedia", null, null, {})