with_lockmode() doesn't allow db-native lockmodes

Issue #814 resolved
jek created an issue

with_lockmode(mode) processing is restricting the set of allowed values to 'read', 'update', and 'update_nowait', but only the dialect is really qualified to make that decision. Maybe push the string translation responsibility down to the for_update_clause.

Comments (4)

  1. Mike Bayer repo owner

    with_lockmode() has been superseded by with_for_update(), which is available with the same calling interface on both select() and Query. It accepts "read", "nowait" as flags as well as "of". so we've exposed the SQL level detail of "FOR UPDATE" and there's not really any translation anymore. with_lockmode() itself translates the string codes into those flags which are then interpreted by the dialect.

  2. Log in to comment