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
{{ message }}
Repository navigation
Trigger function does not give changed value in callback #1119
alasql.fn.onchange = function(r) {
if(r.a == 123) console.log('Observable event!');
};;
alasql('CREATE TABLE one (a INT)');
alasql('CREATE TRIGGER two BEFORE INSERT ON one CALL onchange()');
alasql('INSERT INTO one VALUES (123)'); // This will fire onchange()
Executing this throws an error:
TypeError: Cannot read property 'a' of undefined. The parameter r is undefined
changed the title [-]Trigger function does not give value in callback[/-][+]Trigger function does not give changed value in callback[/+]on Jul 17, 2019
Activity
[-]Trigger function does not give value in callback[/-][+]Trigger function does not give changed value in callback[/+]mathiasrw commentedon Jan 2, 2020
This is terrible. Thank you for letting us know.
retorquere commentedon Mar 20, 2025
Wow this bug still exists almost 6 years later?
Add test for #1119 without fix
retorquere commentedon Apr 3, 2025
inside
execute(databaseid, params, cb)returnsso the trigger function is always called without arguments
retorquere commentedon Apr 4, 2025
#1220 seems to offer a workaround. At the very least the documentation at https://github.com/AlaSQL/alasql/wiki/TRIGGER ought to be updated.
mathiasrw commentedon Oct 21, 2026
Is confirmed working in v4.20.1