-
Notifications
You must be signed in to change notification settings - Fork 0
Test merge #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main-sql
Are you sure you want to change the base?
Test merge #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR merges new virtual file system (VFS) support and IDB registration enhancements into the project.
- Adds a new VFS implementation in C with custom open, lock, and unlock functions.
- Introduces new APIs in JavaScript for registering IDB-based filesystem methods and managing SQLite file mappings.
- Updates build targets in the Makefile to compile the new VFS code and inject externs for the filesystem.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/vfs.c | New VFS implementation and wrappers for SQLite integration |
src/fs-externs.js | Extern definitions for filesystem functions |
src/exported_runtime_methods.json | Updated exported runtime methods list |
src/exported_functions.json | Added new SQLite extension functions |
src/api.js | Enhanced Database API with IDB registration and memory file cleanup |
Makefile | Updated compilation commands and added target for vfs.bc |
// somehow cleanup closed files from `sqliteFiles` | ||
Module["cleanup_file"] = (path) => { | ||
let filesInfo = [...sqliteFiles.entries()] | ||
let fileInfo = filesInfo.find(f => f[1] === path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cleanup_file function does not check if fileInfo is undefined before accessing fileInfo[0], which could lead to a runtime error if no matching file entry is found. Consider adding a check to ensure fileInfo exists before attempting deletion.
let fileInfo = filesInfo.find(f => f[1] === path); | |
let fileInfo = filesInfo.find(f => f[1] === path); | |
if (!fileInfo) { | |
console.warn(`No matching file entry found for path: ${path}`); | |
return; | |
} |
Copilot uses AI. Check for mistakes.
No description provided.