Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Let's do some locking #12

Open Jaymon opened 8 years ago

Jaymon commented 8 years ago

We should be able to pass in serializable=True to the transaction method to cause the begin to do:

BEGIN ISOLATION LEVEL SERIALIZABLE;

Also, it would be cool to add a .lock() method to query that would cause it to add the FOR UPDATE at the end:

SELECT balance FROM accounts WHERE user_id = 1 FOR UPDATE;

via