Hello! I would also like to thank you for this project!
Don't judge strictly, this is my first open source Issue.
I found that in the current version, if you use _asyncsessionmaker or sessionmaker with the expire_on_commit=True parameter (btw it's by default), an error occurs when trying to create an instance of an ORM Model object.
sqlalchemy.exc.MissingGreenlet: greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place? (Background on this error at: https://sqlalche.me/e/20/xd2s)
This happens because the object expires after a commit (which is obvious from the error). My suggestion: add session.refresh(instance) to the create function after session.commit(). This should help and work in both cases of arguments.
Hello! I would also like to thank you for this project! Don't judge strictly, this is my first open source Issue.
I found that in the current version, if you use _asyncsessionmaker or sessionmaker with the expire_on_commit=True parameter (btw it's by default), an error occurs when trying to create an instance of an ORM Model object.
sqlalchemy.exc.MissingGreenlet: greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place? (Background on this error at: https://sqlalche.me/e/20/xd2s)
This happens because the object expires after a commit (which is obvious from the error). My suggestion: add session.refresh(instance) to the create function after session.commit(). This should help and work in both cases of arguments.