On Thu, Feb 28, 2013 at 10:28 AM, Sebastian Elsner <sebast...@risefx.com> wrote:
> Hello,
>
> I want to feed a Query.whereclause to mysqldump. For this i will need the
> full where clause with all labels replaced with values, right now I get
> labels like :project_id_1. How can I do that?
>
> Many thanks,
>
> Sebastian
>

One approach is suggested at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/BindsAsStrings. You
will need to pay attention to the warning at the top of that page - by
not using bound parameters, you open yourself up to SQL Injection
holes, so if you don't trust the user of the system you need to be
very careful about escaping.

To get the compiled version of a query (the equivalent of "d" on that
wiki page) I think you can use the query.selectable property.

Hope that helps,

Simon

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to