maxcountryman / tower-sessions

🥠 Sessions as a `tower` and `axum` middleware.
MIT License
233 stars 43 forks source link

provide expired deletion trait #55

Closed maxcountryman closed 11 months ago

codecov[bot] commented 11 months ago

Codecov Report

Merging #55 (bf12907) into main (a476b8b) will decrease coverage by 2.83%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
- Coverage   82.72%   79.89%   -2.83%     
==========================================
  Files          14       14              
  Lines         579      597      +18     
==========================================
- Hits          479      477       -2     
- Misses        100      120      +20     
Files Coverage Δ
src/diesel_store.rs 75.00% <ø> (-1.79%) :arrow_down:
src/lib.rs 21.42% <ø> (ø)
src/mongodb_store.rs 82.85% <0.00%> (-13.81%) :arrow_down:
src/sqlx_store/mysql_store.rs 90.00% <0.00%> (-7.30%) :arrow_down:
src/sqlx_store/postgres_store.rs 81.81% <0.00%> (-5.99%) :arrow_down:
src/sqlx_store/sqlite_store.rs 79.48% <0.00%> (-6.63%) :arrow_down:
src/session_store.rs 51.35% <0.00%> (-6.23%) :arrow_down:
maxcountryman commented 11 months ago

@weiznich it would be nice to implement this trait for the diesel store, but I couldn't figure out how to do that. Specifically it seems to create an overflow error or improper constraints.

weiznich commented 11 months ago

I think that should be as "simple" as restricting the trait impl on these trait bounds and copying over the existing method:

https://github.com/maxcountryman/tower-sessions/blob/25522d176a4ef605697a4420b5b188238aab6110/src/diesel_store.rs#L198-L207

maxcountryman commented 11 months ago

@weiznich that was my theory too but it causes some kind of overflow.

weiznich commented 11 months ago

That's surprising. I will try to have a look at that next week.