Replies: 6 comments 14 replies
-
Need to test
|
Beta Was this translation helpful? Give feedback.
-
Hi, @downdawn What do you think? |
Beta Was this translation helpful? Give feedback.
-
Not all db operations require transactions update E.g.: def async_session(func):
"""
session 装饰器
:param func:
:return:
"""
async def wrapper(*args, **kwargs):
async with async_session_maker() as db:
return await func(db, *args, **kwargs)
return wrapper
def async_session_begin(func):
"""
session 事务装饰器
:param func:
:return:
"""
async def wrapper(*args, **kwargs):
async with async_session_maker.begin() as db:
return await func(db, *args, **kwargs)
return wrapper |
Beta Was this translation helpful? Give feedback.
-
Suspend the merger #20 When using this decorator, the IDE will lose parameter prompts and checks. |
Beta Was this translation helpful? Give feedback.
-
Hi, @wu-clan Why not just use: And multi-table query will cause exception like the userinfo interface |
Beta Was this translation helpful? Give feedback.
-
This solution has been abandoned. |
Beta Was this translation helpful? Give feedback.
-
It feels good.
If use it, need to change a more practical method name.
Beta Was this translation helpful? Give feedback.
All reactions