-
-
Notifications
You must be signed in to change notification settings - Fork 846
Open
Labels
Description
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
papb, JJosephttg, louisroyer, mrnexeon, MartinLoeper and 2 more
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
MartinLoeper commentedon May 1, 2022
Just stumbled across this. Is it true that
.run()and.get()only execute the first sql command/query in the given string argument?RubenNL commentedon Jun 23, 2022
Spent some time searching just to find this. This really needs to be added to the docs.
itsPG commentedon Dec 5, 2023
Spent much time struggling with this.
Another thing you might want to know:
.execdoesn't accept any param.