docs(litestar): note SQLAlchemyStore has no expired-session cleanup - #788
docs(litestar): note SQLAlchemyStore has no expired-session cleanup#788hasansezertasan wants to merge 2 commits into
Conversation
Store-based session integration (the recommended path) has no delete_expired() equivalent; expiry is lazy and rows are never purged. Document the limitation and a scheduled-cleanup workaround. Refs #787
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e796f3c9e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
on_startup runs once per process; recommend SAQ/cron for periodic cleanup and describe startup only as optional initial sweep.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #788 +/- ##
==========================================
+ Coverage 82.43% 82.45% +0.02%
==========================================
Files 105 105
Lines 9039 9039
Branches 1219 1219
==========================================
+ Hits 7451 7453 +2
+ Misses 1262 1260 -2
Partials 326 326 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|



Description
Store-based session integration is the recommended path, but
SQLAlchemyStorehas nodelete_expired(). Expiry lazy:get()filters expired entries, rows never removed, table grows unbounded. Docs cleanup guidance points atsession_backend.delete_expired()— object store users never create.This PR adds a note under the store-based section documenting the limitation plus a scheduled-cleanup workaround (
DELETE ... WHERE expires_at <= now()). Docs-only; no code change.Proper fix (adding
delete_expired()to the store) tracked separately.Refs #787
📚 Documentation preview: https://litestar-org.github.io/advanced-alchemy-docs-preview/788