Add FORCE_SQLITE Toggle to Avoid Database Conflicts #334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request introduces a FORCE_SQLITE toggle to address database conflicts when using PraisonAI in environments where Supabase or PostgreSQL databases are active. Additionally, it includes a README update and an optional patch system for ease of use in similar situations.
Here’s a well-formatted description for your pull request:
Title:
Add FORCE_SQLITE Toggle to Avoid Database Conflicts
Description:
This pull request introduces a
FORCE_SQLITE
toggle to address database conflicts when usingPraisonAI
in environments where Supabase or PostgreSQL databases are active. Additionally, it includes a README update and an optional patch system for ease of use in similar situations.Changes:
FORCE_SQLITE
Toggle indb.py
FORCE_SQLITE
) has been added to thepraisonai/ui/db.py
file.True
,PraisonAI
will bypass the detection of Supabase/Postgres and exclusively use SQLite as the database backend.users
table definitions betweenPraisonAI
and production applications.Enhanced Logging
Patch System Directory
codePatches
directory with a copy of the patcheddb.py
for users who might need to apply similar fixes without editing the source directly.README
file to explain the purpose and usage of these patches.Updated
.gitignore
Documentation
praisonai/ui/README.md
file to include an explanation of theFORCE_SQLITE
feature and how to enable it.Why This Change Is Necessary:
PraisonAI
and a production application share the same.env
file,PraisonAI
prioritizes Supabase/Postgres connections over SQLite. This leads to schema conflicts, particularly with theusers
table.FORCE_SQLITE
toggle, users can explicitly directPraisonAI
to use a local SQLite database, ensuring separation between production databases and the tool's data needs.How to Use:
FORCE_SQLITE = True
inpraisonai/ui/db.py
..env
file does not interfere with this behavior.PraisonAI
as usual; it will now use SQLite exclusively.Notes for Maintainers:
FORCE_SQLITE
) is desirable, I am happy to contribute a separate PR to introduce a centralized config system.FORCE_SQLITE
toggle in the primary documentation for broader user awareness.Testing:
Supabase
+PraisonAI
) and confirmed that enabling theFORCE_SQLITE
toggle successfully isolatedPraisonAI
to SQLite.Let me know if there are any additional adjustments you'd like me to make! It is my opinion that this would be well suited for a centralized config file where the user can select whichever database they want used instead of having auto-detect, or in addition to having autodetect.
I love you work!