sql-js / sql-js/sql.js

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

Open
#536 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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();
    });

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin at the initSqlJs() callback and inspect the db.exec(query), db.getRowsModified(query), and db.close() flow shown in the report. Determine how a DELETE is retained or persisted after execution, and whether the expected save or reload path is documented. Done means the behavior is clarified or a reproducible transaction/persistence fix is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sqlite, wasm
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.