-
-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
In have some default transactions with steps:
- Get row from database and lock it with FOR UPDATE
- Check/validate row data
- Update row
I cant find a good way for step 1 except providing the statement like this:
await repo.get(
item_id=item_id,
id_attribute='id',
statement=select(Item).with_for_update(),
)
This is inconsistent with update/upsert/...
RepositoryService API, which provide convenient with_for_update
argument.
Maybe consider adding this argument for get*
RepositoryService API?
Pure SA Session.get method includes this argument as well: https://docs.sqlalchemy.org/en/20/orm/session_api.html#sqlalchemy.orm.Session.get
suspiciousRaccoon
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request