Version
main
Platform
Subsystem
sqlite
What steps will reproduce the bug?
import { DatabaseSync } from 'node:sqlite';
const source = new DatabaseSync(':memory:');
const target = new DatabaseSync(':memory:');
source.exec('CREATE TABLE t (id INTEGER PRIMARY KEY)');
target.exec('CREATE TABLE t (id INTEGER PRIMARY KEY)');
const session = source.createSession();
source.exec('INSERT INTO t VALUES (1)');
try {
target.applyChangeset(session.changeset(), {
filter() {
throw new Error('filter failed');
},
});
} catch (error) {
console.log('applyChangeset:', error.message);
}
try {
const result = target.exec('invalid SQL');
console.log('invalid SQL:', result);
} catch (error) {
console.log('invalid SQL threw:', error.message);
}
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
applyChangeset: filter failed
invalid SQL threw: near "invalid": syntax error
The callback-failure state is cleared when applyChangeset() returns, so the invalid SQL throws an SQLite syntax error.
What do you see instead?
applyChangeset: filter failed
invalid SQL: undefined
After catching the filter exception, unrelated invalid SQL silently returns undefined
Additional information
No response
Version
main
Platform
Subsystem
sqlite
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The callback-failure state is cleared when
applyChangeset()returns, so the invalid SQL throws an SQLite syntax error.What do you see instead?
After catching the filter exception, unrelated invalid SQL silently returns
undefinedAdditional information
No response