Skip to content

Database(is_temp_disk=True) option, used for internal database#2684

Merged
simonw merged 7 commits into
mainfrom
claude/temp-disk-database-nh3my
Mar 31, 2026
Merged

Database(is_temp_disk=True) option, used for internal database#2684
simonw merged 7 commits into
mainfrom
claude/temp-disk-database-nh3my

Conversation

@simonw
Copy link
Copy Markdown
Owner

@simonw simonw commented Mar 31, 2026

Refs:

Replace the default in-memory internal database with a temporary
file-backed database using WAL mode. This fixes concurrent read/write
locking errors that occur with named in-memory SQLite databases.

The new is_temp_disk parameter on Database creates a temp file via
tempfile.mkstemp, connects to it as a regular file-based database
with WAL mode enabled, and cleans it up on close() and via atexit.

https://claude.ai/code/session_01TteLrUjpDcARjnP1GMRqz2

claude added 2 commits March 31, 2026 03:29
Replace the default in-memory internal database with a temporary
file-backed database using WAL mode. This fixes concurrent read/write
locking errors that occur with named in-memory SQLite databases.

The new is_temp_disk parameter on Database creates a temp file via
tempfile.mkstemp, connects to it as a regular file-based database
with WAL mode enabled, and cleans it up on close() and via atexit.

https://claude.ai/code/session_01TteLrUjpDcARjnP1GMRqz2
Make is_temp_disk a public attribute (matching is_memory convention)
and document it in the Database constructor reference and properties
section of the internals docs.

https://claude.ai/code/session_01TteLrUjpDcARjnP1GMRqz2
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.80%. Comparing base (94d14e3) to head (8a3ad45).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datasette/database.py 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2684      +/-   ##
==========================================
+ Coverage   90.60%   90.80%   +0.19%     
==========================================
  Files          55       55              
  Lines        8487     8517      +30     
==========================================
+ Hits         7690     7734      +44     
+ Misses        797      783      -14     

☔ 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.

@simonw simonw changed the title Add is_temp_disk option to Database for temp file-backed databases Database(is_temp_file=True) option, used for internal database Mar 31, 2026
@simonw simonw changed the title Database(is_temp_file=True) option, used for internal database Database(is_temp_disk=True) option, used for internal database Mar 31, 2026
@simonw simonw merged commit fc17947 into main Mar 31, 2026
39 checks passed
@simonw simonw deleted the claude/temp-disk-database-nh3my branch March 31, 2026 04:03
simonw added a commit that referenced this pull request Apr 15, 2026
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