-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a custom SessionStore
.
#61
Comments
Whilst it'd be nice to have a better solution, a backup is always to just use See example: |
This was not a use case I imagined when writing the current version, so it is not possible. However, the next version should be able to support this, and will be substantially less prescriptive in usage. I'm surprised that it would be preferable to store key-value pairs in a joined table instead of serializing to a string or json column, but async-session should support whatever session storage model a particular backend needs. I'll leave this issue open until the next minor release, which should be soon |
Thanks! Looking forward to that next release - any way I can help? |
Sure! Take a look at #57 and provide any feedback over there. |
Having had another look over the docs, for anyone coming across the future, I'll be using sqlx json, as this seems like the best solution. |
Hey,
I'm trying to write a custom
MemoryStore
that works with asqlx
postgres database to store sessions foraxum-login
.I've got the following SQL, which has space for all the non-serde-skipped parts of
Session
:Unfortunately, I can't work out a way to get the session contents to/from SQL, as I can't seem to find a constructor for making a
Session
, or getting all of the data - I can get values from keys but if I don't know what keys are being used (and would rather not have to hardcode a list fromaxum-login
), and I can make a new cookie and add data but I can't do things like set the ID.The text was updated successfully, but these errors were encountered: