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 that point is described in the
expression tutorial here:
http://www.sqlalchemy.org/docs/05/sqlexpression.html#insert-expressions
On Jan 10, 2009, at 7:39 AM, Jon wrote:
>
> 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 aswell)
>
> However I haven't managed to do this,,
>
> Thanks for any help
> Jon
>
>
>
>
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---