Skip to content

Conversation

@cofin
Copy link
Member

@cofin cofin commented Apr 5, 2025

Implements a server side session backend using SQLAlchemy. Works with an Async or Sync configuration.

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2025

Codecov Report

❌ Patch coverage is 85.39554% with 72 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.61%. Comparing base (07ed2cc) to head (e0b22c6).

Files with missing lines Patch % Lines
advanced_alchemy/extensions/litestar/store.py 81.95% 33 Missing and 15 partials ⚠️
advanced_alchemy/extensions/litestar/session.py 88.83% 20 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #429      +/-   ##
==========================================
- Coverage   88.35%   78.61%   -9.75%     
==========================================
  Files          84       86       +2     
  Lines        5661     6149     +488     
  Branches      728      771      +43     
==========================================
- Hits         5002     4834     -168     
- Misses        441     1068     +627     
- Partials      218      247      +29     

☔ View full report in Codecov by Sentry.
📢 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.

cofin added 5 commits April 6, 2025 15:29
- Updated `table_name_regexp` to use raw string notation for clarity.
- Refactored session model to inherit from `UUIDv7Base` and updated field names for consistency.
- Simplified session backend initialization and session management methods.
- Enhanced session expiration logic with clearer method names and improved type hints.
- Removed deprecated code related to session model creation and registration.
- Added error handling for rollback statuses in `autocommit_handler_maker`.
- Marked `SessionModelMixin` and `StoreModelMixin` as abstract classes to enforce inheritance.
- Added a setter for the `config` property in `SQLAlchemySessionBackendBase` for improved configurability.
- Updated tests to utilize mock models for session and store, ensuring better isolation and clarity in test cases.
- Refactored session model creation tests to directly define models for clarity and maintainability.
- Improved assertions in tests to compare against current time for expiration checks.
@cofin cofin force-pushed the litestar-server-side-session branch from 93532e2 to ea9d587 Compare April 6, 2025 20:29
@github-actions github-actions bot removed the area/base label Apr 7, 2025
@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 14, 2025

@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/advanced-alchemy-docs-preview/429

@cofin cofin merged commit 3315826 into main Aug 14, 2025
20 checks passed
@cofin cofin deleted the litestar-server-side-session branch August 14, 2025 03:08
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.

4 participants