mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 17:05:56 +03:00
[PR #326] [MERGED] Remove SQLite storage from integration services; migrate token/cache to PostgreSQL and harden monitoring #630
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#630
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/326
Author: @AJaySi
Created: 2/9/2026
Status: ✅ Merged
Merged: 2/9/2026
Merged by: @AJaySi
Base:
main← Head:codex/remove-sqlite3-usage-from-providers-and-services📝 Commits (1)
c701fd4Remove sqlite storage from integrations📊 Changes
19 files changed (+1059 additions, -696 deletions)
View changed files
📝
backend/api/subscription/routes/dashboard.py(+2 -2)📝
backend/api/subscription/routes/logs.py(+2 -2)📝
backend/api/subscription/routes/plans.py(+2 -2)📝
backend/api/subscription/routes/subscriptions.py(+2 -2)📝
backend/api/subscription/utils.py(+0 -1)📝
backend/api/wix_routes.py(+1 -2)📝
backend/routers/bing_oauth.py(+22 -29)📝
backend/routers/gsc_auth.py(+22 -31)📝
backend/services/gsc_service.py(+195 -114)📝
backend/services/integrations/bing_oauth.py(+163 -124)📝
backend/services/integrations/wix_oauth.py(+122 -75)📝
backend/services/integrations/wordpress_oauth.py(+113 -83)📝
backend/services/integrations/wordpress_publisher.py(+103 -67)📝
backend/services/integrations/wordpress_service.py(+93 -69)📝
backend/services/oauth_token_monitoring_service.py(+8 -14)📝
backend/services/scheduler/executors/gsc_insights_executor.py(+7 -41)📝
backend/services/scheduler/executors/oauth_token_monitoring_executor.py(+180 -35)📝
backend/services/subscription/limit_validation.py(+0 -3)📝
docs/Onboarding/DEVELOPER_GUIDE.md(+22 -0)📄 Description
Motivation
alwrity.dbpath from integration providers and related services and migrate token/cache storage to the PostgreSQL user-data DB session to enforce SSOT and production-grade behavior.Description
sqlite3usage anddb_path="alwrity.db"constructors in integration modules (gsc_service,bing_oauth,wordpress_oauth,wix_oauth,wordpress_service,wordpress_publisher,wordpress_publisher) with a shared PostgreSQL-backed session helperservices.database.get_user_data_db_session()and a local@contextmanager _db_sessionhelper in each service.sqlalchemy.text()SQL executed against the PostgreSQL session (e.g.BIGSERIAL,CURRENT_TIMESTAMP,INTERVAL) and replacedsqlite-specific SQL idioms with Postgres equivalents.user_idon success, and adjusted OAuth callback routers (gsc_auth,bing_oauth) to use the returneduser_idto create platform insights tasks (no filesystem DB lookups).OAuthTokenMonitoringExecutor: removed hardcoded sqlite paths, created more robust logging, added Wix token checking/refresh viaWixOAuthServiceandWixService, tightened expiry parsing (use UTC), and improved failure/alert lifecycle and messages.sqlite3exception handling withSQLAlchemyErrorwhere appropriate).GSCService.handle_oauth_callbacknow returnsDict[str, Any]with success metadata;BingOAuthService.handle_oauth_callbackincludesuser_idin its response.get_latest_cached_analyticshelper onGSCServiceand updatedGSCInsightsExecutorto read cached analytics via that helper.docs/Onboarding/DEVELOPER_GUIDE.mdwith an "Integration Framework (PostgreSQL-first)" section and an "Onboarding Requirement for Integrations" note.Testing
Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.