sql.js icon indicating copy to clipboard operation
sql.js copied to clipboard

There is no commit for transactions? (No way to DELETE rows / etc?)

Open webdevbrian opened this issue 3 years ago • 0 comments

Hi -- I'm attempting to DELETE a row in a simple query, however I can't db.commit(query); because it doesn't exist with sql.js seemingly? It takes the query just fine but obviously it's never committed for the changes.

Any ideas / work arounds used by other people?

Thanks

    initSqlJs().then(function (SQL) {
      const db = new SQL.Database(dbFile);
      const res = db.exec(query);
      const modified = db.getRowsModified(query);
      // db.commit(query); This doesn't exist...

      console.log(res); // shows a blank array []
      console.log(modified); // Shows the amount of "modified" rows

      resolve(res);
      db.close();
    });

webdevbrian avatar Nov 26 '22 19:11 webdevbrian