Skip to content

Validate table/view existence in virtual file system#41

Closed
zknpr wants to merge 1 commit intomainfrom
jules-validate-table-existence-10056005998161266617
Closed

Validate table/view existence in virtual file system#41
zknpr wants to merge 1 commit intomainfrom
jules-validate-table-existence-10056005998161266617

Conversation

@zknpr
Copy link
Copy Markdown
Owner

@zknpr zknpr commented Feb 7, 2026

Implemented table/view existence validation in src/virtualFileSystem.ts by querying sqlite_schema. This replaces a placeholder assumption and improves robustness.Verified using existing tests and compilation checks.
Note: package-lock.json was reverted to avoid unrelated changes.


PR created automatically by Jules for task 10056005998161266617 started by @zknpr

- Added validation check in `readFile` to ensure the target table or view exists in `sqlite_schema`.
- Replaced placeholder `isTable` variable with actual SQL query.
- Throws `FileSystemError.FileNotFound` if the target is invalid.

This prevents errors when accessing non-existent tables or views and fulfills the TODO item.

Co-authored-by: zknpr <96851588+zknpr@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sq-lite-explorer Ready Ready Preview, Comment Feb 7, 2026 1:40pm

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @zknpr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the reliability of the virtual file system by implementing a concrete validation step for database entities. Instead of assuming a target is a valid table, it now performs a direct check against the database schema. This change prevents potential issues arising from operations on non-existent tables or views, making the system more resilient and predictable.

Highlights

  • Table/View Existence Validation: Replaced a placeholder assumption (isTable = true) with actual validation to check if a target is a valid table or view within the SQLite schema.
  • Robustness Improvement: The system now queries sqlite_schema to verify the existence of tables or views before proceeding with operations, enhancing the robustness of the virtual file system.
  • Error Handling: Introduced error handling to throw a vsc.FileSystemError.FileNotFound if the specified table or view does not exist in the database.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/virtualFileSystem.ts
    • Removed the isTable = true placeholder.
    • Added a SQL query to sqlite_schema to verify if a given name corresponds to an existing table or view.
    • Implemented a check to throw vsc.FileSystemError.FileNotFound if the table or view is not found in the schema.
Activity
  • The pull request was automatically created by Jules for task 10056005998161266617, initiated by @zknpr.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the robustness of the virtual file system by validating the existence of a table or view before attempting to read from it. The implementation is correct and uses a parameterized query against sqlite_schema. I've suggested one improvement: to apply the same validation logic to the writeFile method for consistency and better error reporting.

Comment thread src/virtualFileSystem.ts
Comment on lines +63 to +69
// Verify if the target is a valid table or view in the schema.
const checkQuery = `SELECT 1 FROM sqlite_schema WHERE type IN ('table', 'view') AND name = ?`;
const checkResult = await document.databaseOperations.executeQuery(checkQuery, [table]);

if (!checkResult?.[0]?.rows?.length) {
throw vsc.FileSystemError.FileNotFound(uri);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a great improvement for robustness. To ensure consistency across file operations, I recommend applying the same existence check to the writeFile method in this file. Currently, attempting to write to a non-existent table or view results in a generic vsc.FileSystemError.Unavailable error. Adding this validation would provide a more specific vsc.FileSystemError.FileNotFound error, aligning with the behavior of readFile and improving the developer experience.

@zknpr
Copy link
Copy Markdown
Owner Author

zknpr commented Feb 7, 2026

Merged as part of v1.3.0 release in PR #65

@zknpr zknpr closed this Feb 7, 2026
@google-labs-jules
Copy link
Copy Markdown
Contributor

Merged as part of v1.3.0 release in PR #65

Acknowledged. Glad to hear it's included in v1.3.0.

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.

1 participant