Closed beckend closed 10 months ago
ahh your talking about the Else statements how its not using the config. That is a easy enough fix as they should of been using that. Or do you mean something else like adding UUID's manually to the filter? @beckend
I think I mean that this line errors, since the database has no such table yet, I am getting of course a db error:
let ids = client.get_ids(&config.table_name).await?;
This phase is creating the session store, however the session store lets you do .initiate()
only after creation.
Error: creating session store
Caused by:
0: error returned from database: relation "sessions" does not exist
1: relation "sessions" does not exist
Yeah good catch.
I can do this in one of two ways 1.) make new create the Table if it does not Exist. 2.) Split the Filter seeding off into its own function to be called later.
Personally 1 would be better since its only called Once and it requires less work on the Developers using the crate. It also means less Errors on the developer side for forgetting to do it themselves. But it means a API change.
2 would mean adding a new function which would be a fix but people could forget to call it which results in UUID not making it into the filter table so id prefer against this. So I will work on the latter since this makes more sense in the long run.
Vote for 1.
Ok I have published a new release that should fix this problem. Please give it a test.
axum_session = { version = '0.5.0', default-features = false, features = [
'postgres-native',
'fastbloom-rs',
'key-store',
] }
now works as expected.
https://github.com/AscendingCreations/AxumSession/blob/main/src/session_store.rs#L84-L106
It's not possible to seed the database unless you create a session store, but with the feature, we don't get that chance.