django / django/new-features

Add support for `SELECT ... FOR UPDATE WAIT n`

Open
#24 2 comments 13 reactions 0 assignees View on GitHub
Models/ORM
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow Django's Code of Conduct

### Feature Description

MariaDB supports `SELECT ... FOR UPDATE WAIT n` since version 10.3.0. I'd like to be able to use that feature through the Django ORM.
Ref: https://mariadb.com/kb/en/wait-and-nowait/

### Problem

Right now I don't have a clean mechanism to set a timeout on a locking statement. I'd like to be able to set a guardrail in a form of a timeout for long running transactions.

### Request or proposal

proposal

### Additional Details

_No response_

### Implementation Suggestions

I'd extend the `select_for_update` signature to allow an extra argument, something like `select_for_update(wait=n)`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.