I'm trying to achieve a very simple thing:
START TRANSACTION;
DELETE FROM table WHERE id = 1;
ROLLBACK;
Running this on the postgres
database works perfectly. With massive.js
it doesn't:
this.db.run(
"START TRANSACTION",
[]
);
setTimeout(() => {
this.db.run(
"DELETE FROM table WHERE id = $1"
[1]
);
}, 2000);
setTimeout(() => {
this.db.run(
"ROLLBACK;"
[]
);
}, 4000);
It doesn't rollback the changes, just deletes from the database. COMMIT
doesn't work as well. What's wrong?
Is there some way to dump queries order?