Adding Transaction Support as a Middle-Step to Supporting User Groups #1445
Uriah372-DS
started this conversation in
Ideas
Replies: 1 comment
-
|
The same goes for sqlalchemy. If you need multiple operations to be done in a transaction, you may need to write a new api function. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Let me start by thanking everyone for this incredibly useful tool, really amazing and lightweight, and also strikes the perfect balance between encapsulating the complexity of authentication and giving control to the developer.
TL;DR: Consider adding support for transactional operations to the database adapters before adding User Groups feature.
I read in your docs sometime ago that you're planning to add support for User Groups / Organizations Management. I was searching for something like this and been trying to extend this library to add this feature on my own, however I've run into a wall when trying to create a User+Organization Registration flow.
Specifically, I copied the full example that uses the Beanie adapter and tried implementing a registration route that registers both a user and an organization (e.g., for B2B applications).
However, this operation ended up consisting of multiple steps that need to be performed against the database:
To ensure consistency, these operations should be done in a transaction, however it seems that transactions aren't supported in the BeanieUserDatabase adapter.
I'd be happy to know what you think about this, if you disagree that this step is necessary and if so then why, and if adding support for user groups is still on the table.
Thanks again!
Beta Was this translation helpful? Give feedback.
All reactions