Skip to content

do not set db_url to sqlite by default#6347

Merged
adhami3310 merged 3 commits intomainfrom
do-not-set-db_url-to-sqlite-by-default
Apr 20, 2026
Merged

do not set db_url to sqlite by default#6347
adhami3310 merged 3 commits intomainfrom
do-not-set-db_url-to-sqlite-by-default

Conversation

@adhami3310
Copy link
Copy Markdown
Member

since database modules are not installed by default, this provides a broken user experience as health metrics fail because db modules aren't isntalled

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 20, 2026

Greptile Summary

This PR changes the default value of db_url in BaseConfig from "sqlite:///reflex.db" to None, preventing health check failures for users who don't have database modules installed. All downstream consumers (check_db_used, check_db_initialized, check_schema_up_to_date, Model.get_db_engine) already handle None gracefully, and tests that exercise SQLite explicitly mock the URL — so the impact is safely scoped.

Confidence Score: 5/5

Safe to merge — single-line default change with no functional regressions.

All code paths that read db_url already guard against None, tests mock the value explicitly, and the docker example sets the URL via an env var. No P0/P1 issues found.

No files require special attention.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/config.py Changes the default db_url from "sqlite:///reflex.db" to None; all downstream consumers handle None cleanly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[App startup] --> B{check_db_used}
    B -- "db_url is None - new default" --> C[Skip DB health check and schema checks]
    B -- "db_url is set explicitly" --> D[Run DB health check]
    D --> E{DB modules installed?}
    E -- Yes --> F[Health check passes]
    E -- No --> G[Health check fails]
Loading

Reviews (1): Last reviewed commit: "do not set db_url to sqlite by default" | Re-trigger Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 20, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing do-not-set-db_url-to-sqlite-by-default (3373b95) with main (cc7436c)

Open in CodSpeed

@adhami3310 adhami3310 merged commit b9f3570 into main Apr 20, 2026
48 checks passed
@adhami3310 adhami3310 deleted the do-not-set-db_url-to-sqlite-by-default branch April 20, 2026 21:17
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