[actions] Replace raw SQLite with SQLAlchemy ORM (#732) #833

Closed
sleepy wants to merge 0 commits from fix/builtin-actions-sqlite-orm-732 into main
Owner

Fixes #732. Replace raw sqlite3 calls in builtin_actions.py with SQLAlchemy ORM queries via new ScheduledSessionLocal engine and EmailBoundary/EmailTag/SenderSignature models.

Fixes #732. Replace raw sqlite3 calls in builtin_actions.py with SQLAlchemy ORM queries via new ScheduledSessionLocal engine and EmailBoundary/EmailTag/SenderSignature models.
Add SQLAlchemy ORM models for the email cache tables
(email_boundaries, email_tags, sender_signatures) that live in the
secondary scheduled_emails.db. Replace all raw sqlite3 calls in
builtin_actions.py with ORM queries via a new ScheduledSessionLocal
session factory.

Changes:
- core/database.py: Add ScheduledBase, ScheduledSessionLocal engine,
  and EmailBoundary/EmailTag/SenderSignature models
- src/builtin_actions.py: Replace 6 raw sqlite3 call sites across 3
  action functions (action_mark_email_boundaries,
  action_learn_sender_signatures, action_check_email_urgency) with
  SQLAlchemy ORM queries

Closes #732
sleepy closed this pull request 2026-06-04 11:42:15 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.