Skip to content

AI junk - #1427

Closed
princ0301 wants to merge 1 commit into
pallets-eco:mainfrom
princ0301:fix-1314-using-sqlite-uri-filename-format-for-inm
Closed

AI junk#1427
princ0301 wants to merge 1 commit into
pallets-eco:mainfrom
princ0301:fix-1314-using-sqlite-uri-filename-format-for-inm

Conversation

@princ0301

Copy link
Copy Markdown

Fixes #1314

Summary

When using a SQLite URI for an in-memory database like sqlite:///file::memory:?uri=true, Flask-SQLAlchemy was incorrectly treating it as a file-based database and creating a file on disk. This was due to the logic in _apply_driver_defaults not recognizing this specific URI format as an in-memory database. The fix is to update the condition that checks for in-memory SQLite databases to also include the case where uri=true is used with file::memory:. A regression test is added to ensure that no file is created on disk for this URI format and that the correct in-memory database settings (like StaticPool) are applied.

Validation

Tests passing after 1 attempt(s).

tests/test_model_name.py ............................................... [ 57%]
.....................................                                    [ 65%]
tests/test_pagination.py ............................................... [ 75%]
..............................                                           [ 82%]
tests/test_record_queries.py .                                           [ 82%]
tests/test_session.py ..............................                     [ 89%]
tests/test_table_bind.py ....................                            [ 93%]
tests/test_track_modifications.py .....                                  [ 94%]
tests/test_view_query.py .........................                       [100%]
======================== 460 passed, 2 skipped in 4.43s ========================

@davidism davidism closed this May 24, 2026
@davidism davidism changed the title fix: Using SQLite URI filename format for in-memory database still creates a file (#1314) AI junk May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Using SQLite URI filename format for in-memory database still creates a file

2 participants