Repository navigation
fix: allow lazy worker queries after closing the database - #638
Merged
lovasoa merged 1 commit intoOct 11, 2026
Merged
Conversation
Follow up on the null-reset proposed by WilliamStephens in sql-js#216; preserve the explicit reopening behavior added in sql-js#379. Assisted-by: Hermes Signed-off-by: sergioperezcheco <checo520@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closing a database leaves the worker holding the closed instance, so the existing lazy initialization in
execandeachnever runs again. Clear that reference after a successful close; subsequent queries create an empty database, while repeated close and explicit reopening still work.WilliamStephens proposed the null-reset in #216. The merged follow-up #379 covered explicit reopening but did not retain that reset; this completes the remaining implicit
exec/eachlifecycle with regression coverage rather than changing the worker API. Related to #217, without claiming to resolve the SqlDelight/storage question in #617.Validated a fresh EMSDK 5.0.0 rebuild,
npm test, lint and documentation generation. The new regression fails against the original worker and passes with the fix; real headless Chromium checks pass for six worker bundles, and an independent Node worker check verifies repeated close, lazy queries and removal of the old schema. Linux/Docker and other browser/OS matrices were not run locally. AI-assisted with Hermes; source, historical attribution, tests and public behavior were reviewed and exercised by the submitting automation.