[sqlalchemy] Re: How to lock database row on select?

2006-11-15 Thread Basil Shubin
Basil Shubin пишет: Hi friends! I have use SQLAlchemy 0.3 with MySQLdb 1.2.1 How I can lock row in database table when I select it? So nobody can access it in same time. BTW I use tables with InnoDB engine. Okey, I discover 'lockmode' parameter. And how I can use it (or anything else) to

[sqlalchemy] A better CascadeOptions impl

2006-11-15 Thread dmiller
Here's a better CascadeOptions implementation: from sets import Set class CascadeOptions(Set): keeps track of the options sent to relation().cascade def __init__(self, arg=): values = util.Set([c.strip() for c in arg.split(',')]) if delete-orphan in values:

[sqlalchemy] session.flush calls commit, and Binary issue

2006-11-15 Thread bkc
Using sqlalchemy rev 2102 is flush supposed to commit by itself? Also, looks like Binary fields get flushed every time, even when not changed.. Again, using wsgi middleware to automatically rollback if an exception occurs in my app, I have a use case where I absolutely must commit a

[sqlalchemy] Re: autoincrement always True

2006-11-15 Thread Michael Bayer
autoincrement defaults to true. in previous versions of SA, this was not even an option; SERIAL and AUTO_INCREMENT were always used for integer primary key columns in postgres and mysql, respectively, which is why this is the default. note that autoincrement is meaningless for sqlite (which

[sqlalchemy] Re: session.flush calls commit, and Binary issue

2006-11-15 Thread Michael Bayer
flush() starts its own transaction and commits it. if you have already opened a transaction on the current session, then it will nest inside the larger transaction. see the SessionTransaction documentation for details. Also, the pickle type not getting updated is something that was fixed in

[sqlalchemy] GUI + SQLAlchemy?

2006-11-15 Thread Basil Shubin
Hi friends! Is there standalone GUI application that using SQLAlchemy? Of course it should be open source apps. -- Basil Shubin Freelance Software Developer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Some questions about SqlAlchemy

2006-11-15 Thread guic
Hi, I have some questions about SqlAlchemy. 1. I know I can define a relation on a Class and load records of the relation in only one select (eager loading), but I see SqlAlchemy uses a LEFT OUTER JOIN to join. If I would filter records by a WHERE CLAUSE on a relation, I would like to

[sqlalchemy] Re: GUI + SQLAlchemy?

2006-11-15 Thread Karl Guertin
On 11/14/06, Basil Shubin [EMAIL PROTECTED] wrote: Is there standalone GUI application that using SQLAlchemy? Of course it should be open source apps. There is neither an open source nor a commercial GUI interface for SQLAlchemy. --~--~-~--~~~---~--~~ You

[sqlalchemy] redirect sqlalchemy log to stderr

2006-11-15 Thread [EMAIL PROTECTED]
Hello there, Is there any simple way to redirect sqlalchemy log to stderr? I did not find any examples for this. I'm developing a web application with sqlalchemy using web.py, and it's quite annoying to have debug output in stdout. Thanks, --- Regards, Dmitry

[sqlalchemy] Re: session.flush calls commit, and Binary issue

2006-11-15 Thread bkc
I am using PickleType, and Binary on the same table.. I'll see if I can come up with a small test. These fields are being written back every time any other field changes, even when they haven't changed. Regarding transactions. I thought session.flush was just UOW work and didn't actually do

[sqlalchemy] Re: session.flush calls commit, and Binary issue

2006-11-15 Thread Michael Bayer
let me tell you how pickletype works right now (by default, you can change it). there is a method on all TypeEngine objects called compare_values(). this method is now used by the attributes package when it checks if something changed. in most cases, the method uses a the == comparison. In the

[sqlalchemy] Re: How to lock database row on select?

2006-11-15 Thread Basil Shubin
Mike Bernson пишет: use the lockmode='update' on a query object. row_obj = query_obj.select(where, lockmode='update').execute() self.localTowns = Table('local_towns', self.metadata, Column('id', Integer, primary_key=True), Column('title',

[sqlalchemy] Re: How to lock database row on select?

2006-11-15 Thread Basil Shubin
Mike Bernson пишет: use the lockmode='update' on a query object. row_obj = query_obj.select(where, lockmode='update').execute() self.localTowns = Table('local_towns', self.metadata, Column('id', Integer, primary_key=True), Column('title',