Skip to content

feat: apply SQLite WAL pragmas and a writer/readonly pool - #910

Open
numdinkushi wants to merge 1 commit into
ritik4ever:mainfrom
numdinkushi:feat/731-sqlite-wal-pool-tuning
Open

feat: apply SQLite WAL pragmas and a writer/readonly pool#910
numdinkushi wants to merge 1 commit into
ritik4ever:mainfrom
numdinkushi:feat/731-sqlite-wal-pool-tuning

Conversation

@numdinkushi

Copy link
Copy Markdown

Commit Type

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (formatting, etc.)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • build: Changes affecting the build system or external dependencies
  • ci: Changes to CI/CD configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Breaking change? (If yes, add BREAKING CHANGE in the commit footer)

  • Yes — this contains a breaking change
  • No

What changed

SQLite init now applies WAL, busy_timeout=5000, and cache_size=-64000 from backend/src/services/sqlite/. initDb() opens one writer (getDb()) plus a readonly reader (getReadDb(), SQLITE_READ_POOL_SIZE, max 4). In-memory databases skip extra readers.

Tuning is recorded in docs/adr/0006-sqlite-wal-and-pool-tuning.md.

Existing getDb() call sites are unchanged.

Testing done

  • npx vitest run src/services/sqlite src/db/concurrency.test.ts — 12 passed
    • WAL + busy_timeout + cache_size on writer and reader
    • reader snapshot during an open write transaction
    • busy_timeout waits on a lock instead of failing immediately
    • initDb() applies the same pragmas
  • npx eslint src/services/db.ts src/services/sqlite src/db/concurrency.test.ts

Related issues

Closes #731

Checklist

  • I used the correct commit type (see above) for the squashed commit message.
  • I kept the change focused on the related issue.
  • I added or updated tests where useful.
  • I updated documentation where behavior changed.
  • I verified the app still builds or explained why verification was skipped.
  • My commits follow Conventional Commits (enforced by commitlint).

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@numdinkushi is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@numdinkushi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e587e555-3066-4c3f-882b-2679aef29b7f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[FEATURE] Add SQLite WAL mode and connection pool tuning

1 participant