You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know there is a sync version of beanie. But in our project, we use common model in two ways: sync and async. So we would like to define our models only once.
Is it possible to add *_sync versions for sync usage? It will be super cool!
I know it can make a code looks uglier, but for us it's a required feature (we have a lot of AI stuff written in sync style, and our API is written in FastAPI async, so we need to support both methods).
For example, Node.js has similar pattern: fs.readFile & fs.readFileSync, which is not a nice looking, but if a world of split on sync/async is a necessary evil. 🙄
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Pretty cool lib!
I know there is a sync version of beanie. But in our project, we use common model in two ways: sync and async. So we would like to define our models only once.
Is it possible to add
*_sync
versions for sync usage? It will be super cool!I know it can make a code looks uglier, but for us it's a required feature (we have a lot of AI stuff written in sync style, and our API is written in FastAPI async, so we need to support both methods).
For example, Node.js has similar pattern: fs.readFile & fs.readFileSync, which is not a nice looking, but if a world of split on sync/async is a necessary evil. 🙄
Beta Was this translation helpful? Give feedback.
All reactions