You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've following table in sqlite [TEMP_COMMODITY_UUIDS]:
CREATETABLETEMP_COMMODITY_UUIDS (
ID INTEGERNOT NULLPRIMARY KEY AUTOINCREMENT
REFERENCES COMMODITY (ID) ON DELETE CASCADE,
UUID TEXTNOT NULL,
BACKEND_UUID TEXT
);
When I try to execute in browser:
alasql([
'ATTACH SQLITE DATABASE db("test.dat");
USE db;
select * from TEMP_COMMODITY_UUIDS'
]).then(function(res){
console.log("test:",res.pop());
});
I got:
> Uncaught SyntaxError: Parse error on line 1:
...ES COMMODITY(ID) ON DELETE CASCADE, [UUI
-----------------------^
Expecting 'UPDATE', got 'DELETE'
at Parser.parser.parseError (alasql.js:2210)
at Parser.parse (alasql.js:2084)
at Function.alasql.parse (alasql.js:4396)
at alasql.js:17141
at Array.forEach (<anonymous>)
at alasql.js:17138
It seems, alasql.js (0.4.0) can't understand 'ON DELETE CASCADE' construction of sqlite.
Similar query, using sql.js directly work just right.
Activity
[-]sqlite table: Expecting 'UPDATE', got 'DELETE'[/-][+]CASCADE not supported (sqlite) [/+]mathiasrw commentedon Jun 30, 2017
Great input! thanks for taking the time to describe.
Handling
CASCADEis not implemented at the moment. Ill set it as a feature request!ChristopherHButler commentedon Jul 20, 2022
It seems
CASCADEis still not supported in 2022. Is there any plans for this in the near future?Thanks!
mathiasrw commentedon Sep 25, 2022
@ChristopherHButler We are happy to look at any pull request with this. I have not heard of any people working on this now.
Add parser support for ON DELETE and ON UPDATE CASCADE to close AlaSQ…
mathiasrw commentedon Dec 13, 2025
We made sure the parser does not throw an error as part of v4.12.0 but its not executing cascade functinoality.