Skip to content

docs(litestar): note SQLAlchemyStore has no expired-session cleanup - #788

Open
hasansezertasan wants to merge 2 commits into
mainfrom
docs/store-session-expired-cleanup
Open

docs(litestar): note SQLAlchemyStore has no expired-session cleanup#788
hasansezertasan wants to merge 2 commits into
mainfrom
docs/store-session-expired-cleanup

Conversation

@hasansezertasan

@hasansezertasan hasansezertasan commented Aug 17, 2026

Copy link
Copy Markdown
Member

Description

Store-based session integration is the recommended path, but SQLAlchemyStore has no delete_expired(). Expiry lazy: get() filters expired entries, rows never removed, table grows unbounded. Docs cleanup guidance points at session_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

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread docs/usage/frameworks/litestar.rst Outdated
on_startup runs once per process; recommend SAQ/cron for periodic
cleanup and describe startup only as optional initial sweep.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.45%. Comparing base (c5ea0c9) to head (2e1f9b9).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants