Hi,

I'm not sure if I'm approaching this incorrectly or missed some 
documentation but I cannot come up with any combination of SQLAlchemy 
methods to generate LOCK IN SHARE MODE.

Here's a simple example:
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()

class SomeClass(Base):
    __tablename__ = 'some_table'
    id = Column(Integer, primary_key=True)
    name =  Column(String(50))

Works as expected:
>>> print SomeClass.__table__.select(SomeClass.id == 1).with_for_update()
SELECT some_table.id, some_table.name
FROM some_table
WHERE some_table.id = :id_1 FOR UPDATE


Does not work as expected:
>>> print SomeClass.__table__.select(SomeClass.id == 
1).with_for_update(read=True)
SELECT some_table.id, some_table.name
FROM some_table
WHERE some_table.id = :id_1 FOR UPDATE
I was expecting:
SELECT some_table.id, some_table.name
FROM some_table
WHERE some_table.id = :id_1 LOCK IN SHARE MODE


Am I missing something here?

Thanks in advance,

Stu

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to