Skip to content

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

Open
wants to merge 5 commits into
base: main-sql
Choose a base branch
from
Open

Test merge #2

wants to merge 5 commits into from

Conversation

ojamin
Copy link
Owner

@ojamin ojamin commented May 7, 2025

No description provided.

@ojamin ojamin requested a review from Copilot May 7, 2025 17:34
Copy link

@Copilot Copilot AI left a 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);
Copy link
Preview

Copilot AI May 7, 2025

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants