Skip to content

Amend #3072 DELETE without WHERE on IndexedDB - #3078

Merged
mathiasrw merged 1 commit into
developfrom
fix/1217-amend
Nov 17, 2026
Merged

mathiasrw merged 1 commit into
developfrom
fix/1217-amend

Conversation

@mathiasrw

Copy link
Copy Markdown
Member

Follows up #3072 by @shaktimaan00, which fixed #1217.

#3072 sends DELETE FROM t without WHERE to the engine's deleteFromTable, which is what fixes IndexedDB. It also limited the loadTableData and saveTableData calls to LOCALSTORAGE and FILESTORAGE by name. That part is not needed for the fix, as IndexedDB returns before reaching those calls, and it broke an engine registered by the user that defines both methods.

alasql.engines.MYENGINE = function () {};
alasql.engines.MYENGINE.loadTableData = (d, t) => { alasql.databases[d].tables[t].data = [{id: 1}, {id: 2}]; };
alasql.engines.MYENGINE.saveTableData = (d, t) => {};
alasql('CREATE DATABASE my; CREATE TABLE my.t (id INT)');
alasql.databases.my.engineid = 'MYENGINE';
alasql('DELETE FROM my.t'); // 2 before #3072, TypeError after it

This restores the original conditions for the branch without WHERE and keeps the delegation. The WHERE branch is unchanged.

In test/test1217.js the stub no longer returns a count, as the real IndexedDB engine returns nothing and passes the count to the callback, so the test now checks the callback. A new test covers an engine registered by the user, and it fails without the change.

@mathiasrw mathiasrw added this to the v4.x Focus milestone Nov 17, 2026
@mathiasrw
mathiasrw merged commit cd26eb4 into develop Nov 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indexeddb Delete from is not working

1 participant