The documentation for sqlalchemy says that you can specify "FOR UPDATE NOWAIT" in PostgreSQL 8.1 upwards using Query.with_lockmode('update_nowait'). Does anyone know how to get it to add the FOR UPDATE NOWAIT instead of just FOR UPDATE?
PostgreSQL 9.1.6
query = db.session.query(MyTable)\
.filter_by(process_status="PENDING")\
.order_by(MyTable.id)\
.with_lockmode('update_nowait')\
print query
sql:
SELECT
MyTable.id AS MyTable_id
,MyTable.created_on AS MyTable_created_on
FROM MyTable
WHERE MyTable.process_status = :process_status_1
ORDER BY MyTable.id
FOR UPDATE