Skip to content

sqlite - feat: Add warning for WAL mode with in-memory SQLite databases#1832

Merged
jaredwray merged 2 commits intomainfrom
claude/add-wal-warning-logging-beZu1
Feb 4, 2026
Merged

sqlite - feat: Add warning for WAL mode with in-memory SQLite databases#1832
jaredwray merged 2 commits intomainfrom
claude/add-wal-warning-logging-beZu1

Conversation

@jaredwray
Copy link
Owner

What kind of change does this PR introduce?
Bug fix and documentation update

Description
This PR improves the handling of WAL (Write-Ahead Logging) mode when used with in-memory SQLite databases. Previously, the code would silently attempt to enable WAL mode on in-memory databases, which SQLite would ignore without any feedback to the user.

Changes

  • Added explicit detection for in-memory databases (:memory: and empty string)
  • Added a console warning when WAL mode is requested for in-memory databases
  • Updated the README to clarify that a warning will be logged and the option will be ignored
  • Only execute the WAL pragma when the database is not in-memory

Rationale
This change provides better developer experience by:

  1. Making it clear to users why WAL mode isn't being applied
  2. Avoiding unnecessary database operations
  3. Preventing silent failures that could lead to confusion about performance characteristics

Testing

  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

https://claude.ai/code/session_01ESQBgre2YMC66TdTca7YdG

When WAL mode is requested for an in-memory database (:memory: or empty
string), the code now logs a warning message to inform developers that
the option will be ignored, rather than silently passing the PRAGMA
to SQLite which would silently ignore it.

https://claude.ai/code/session_01ESQBgre2YMC66TdTca7YdG
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaredwray, 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 enhances the KeyvSqlite adapter by providing clearer feedback to developers when attempting to use Write-Ahead Logging (WAL) mode with in-memory SQLite databases. Previously, such attempts would silently fail, leading to potential confusion. The changes introduce explicit detection for in-memory databases, log a warning when WAL mode is requested in this scenario, and update documentation to reflect this behavior, ultimately improving the developer experience and preventing silent misconfigurations.

Highlights

  • In-memory database detection: Added explicit checks for ':memory:' and empty string database paths to accurately identify in-memory SQLite instances.
  • WAL mode warning: Introduced a console warning that is logged when a user attempts to enable WAL mode on an in-memory SQLite database, clarifying that the option will be ignored.
  • Documentation update: Updated the 'README.md' to reflect the new behavior, informing users that a warning will be logged and WAL mode will be ignored for in-memory databases.
  • Conditional WAL pragma: Modified the code to only execute the 'PRAGMA journal_mode=WAL' command if the database is not an in-memory instance, preventing unnecessary operations.
Changelog
  • packages/sqlite/README.md
    • Updated the note for the 'wal' option to indicate that a warning will be logged and the option ignored when used with in-memory databases, instead of silently ignoring it.
  • packages/sqlite/src/index.ts
    • Added logic to detect if the database connection string is ':memory:' or an empty string, signifying an in-memory database.
    • Implemented a 'console.warn' message to inform users when WAL mode is requested for an in-memory database.
    • Wrapped the 'PRAGMA journal_mode=WAL' execution within a conditional block, ensuring it only runs for persistent databases.
Activity
  • The pull request introduces a bug fix and documentation update.
  • The author, jaredwray, has provided a detailed description of the changes, rationale, and testing status.
  • No explicit reviewer comments or approvals are present in the provided context.
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
Contributor

@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 handling of WAL mode for in-memory SQLite databases by adding a warning and skipping the unnecessary PRAGMA call. The changes are clear and improve the developer experience. The documentation in the README has also been updated accordingly.

My main feedback is regarding testing. The new warning mechanism is not covered by automated tests, which is important to prevent regressions. I've left a comment with a suggestion on how to add a test for this new behavior.

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d195061) to head (7ed5781).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1832   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         2430      2434    +4     
  Branches       443       446    +3     
=========================================
+ Hits          2430      2434    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaredwray jaredwray changed the title Add warning for WAL mode with in-memory SQLite databases sqlite - feat: Add warning for WAL mode with in-memory SQLite databases Feb 4, 2026
@jaredwray jaredwray merged commit 0e971c3 into main Feb 4, 2026
10 checks passed
@jaredwray jaredwray deleted the claude/add-wal-warning-logging-beZu1 branch February 4, 2026 01:41
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.

2 participants