node-sqlite3
node-sqlite3 copied to clipboard
No support for multiple commands in run
I tried to add tables for two days. The query was:
db.run(`
PRAGMA foreign_keys = ON;
CREATE TABLE pkgs( .... );
CREATE TABLE subs( ... );
`);
And this query do nothing. Wow! The bug is only first command runs! Solution? Yey, just change db.run to db.exec. Please, fix multiple commands in run or tell about this on wiki docs. sqlite3 version: 4.0.6 node version: 11.7.0
Just stumbled across this. Is it true that .run() and .get() only execute the first sql command/query in the given string argument?
Spent some time searching just to find this. This really needs to be added to the docs.
Spent much time struggling with this.
Another thing you might want to know: .exec doesn't accept any param.