[sqlalchemy] Re: Self-Referential Mapping with Base?

2009-01-10 Thread MikeCo
One thing to notice about ignoring the ids completely. This can introduce inefficiencies when updating records. In the sample function tst3() the line child.parent = parent causes SA to read the old parent record to get the attribute child.parent. Changing to: child.id_d = parent.id

[sqlalchemy] Re: Self-Referential Mapping with Base?

2009-01-10 Thread Darren Govoni
Interesting to know. Appreciate the examples! On Sat, 2009-01-10 at 05:38 -0800, MikeCo wrote: One thing to notice about ignoring the ids completely. This can introduce inefficiencies when updating records. In the sample function tst3() the line child.parent = parent causes SA to

[sqlalchemy] session.query print sql

2009-01-10 Thread Jon
Hi, A simple question,,that I cant find the answer to,, Im using session.query and filter() to generate some sql... I would like to print out the whole sql statement with the bind variables displayed aswell,,,(I actually want to md5 this string o get a key, which is why I need the variables

[sqlalchemy] Re: session.query print sql

2009-01-10 Thread Michael Bayer
echo=True dumps the statement and a repr() of the bind params as a dictionary to the log. alternatively, the Query's expression construct is available as: query.statement getting the str() of any SQLA expression construct as well as direct access to the bind param dictionary at

[sqlalchemy] Re: Error Connecting to MSSQL using pyodbc and SqlAlchemy 0.5.0

2009-01-10 Thread Michael Bayer
On Jan 10, 2009, at 12:10 AM, Lukasz Szybalski wrote: On Fri, Jan 9, 2009 at 4:46 PM, Rick Morrison rickmorri...@gmail.com wrote: The MSSQL connection string changed for the 0.5 final release. In particular, the dsn keyword is removed, and the pyodbc connection string now expects the

[sqlalchemy] Re: MS SQL wrapper for pymssql DBAPI broken in 0.5.0

2009-01-10 Thread Michael Trier
1. Override do_begin so that it creates a cursor and then executes on the cursor: def do_begin(self, connection): cursor = connection.cursor() cursor.execute(SET IMPLICIT_TRANSACTIONS OFF) cursor.execute(BEGIN TRANSACTION) this would be appropriate since