i haven't followed this closely, worth updating the recipe on the SQLA wiki ?



On Mar 9, 2012, at 2:06 PM, Randy Syring wrote:

> I checked out that function and it turns out that I actually do have problems 
> with:
> 
> q = db.sess.query(Blog).filter(Blog.title == u'foo').limit(10).offset(5)
> 
> results in:
> 
> SELECT blogs.id, blogs.createdts, blogs.updatedts, blogs.title, blogs.ident 
> FROM blogs 
> WHERE blogs.title = ?
>  LIMIT ? OFFSET ?
> 
> However, I was mistaken in my original post.  The problem was not with the 
> helper function but with the way I was doing my testing.  The full 
> implementation of the helper function is here:
> 
> http://stackoverflow.com/a/5698357/182111
> 
> ---------------------------------------------
> Randy Syring
> Development & Executive Director
> Level 12 Technologies (formerly Intelicom)
> Direct: 502-276-0459
> Office: 502-212-9913
> 
> Intelicom is now Level 12 Technologies, learn more about our name change.
> Please update your address book with my new email address.
> 
> Principled People, Technology that Works
> 
> On 03/09/2012 03:25 AM, Alex K wrote:
>> 
>> We use this recipe and in 0.7.5 it works ok with limit and offset.
>> 
>> http://www.sqlalchemy.org/trac/wiki/UsageRecipes/old/DebugInlineParams
>> 
>> 
>> On Fri, Mar 9, 2012 at 10:32 AM, Randy Syring <rsyr...@gmail.com> wrote:
>> I found a recipe on stackoverflow for turning a query instance into a 
>> string, including parameters.  I only do this for testing purposes and the 
>> implementation is here:
>> 
>> https://bitbucket.org/rsyring/sqlalchemybwc/src/292597b37736/sqlalchemybwc/lib/testing.py
>> 
>> However, I just upgraded to 0.7.5 and it would appear this recipe does not 
>> handle LIMIT/OFFSET becoming parameterized.  I get the following when using 
>> the function:
>> 
>> "...persons.last_name AS persons_last_name FROM persons LIMIT :param_1 
>> OFFSET :param_2"
>> 
>> I'm in over my head on SA internals on this one and would appreciate 
>> suggestions.
>> 
>> Thanks in advance.
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/sqlalchemy/-/ryYu6nVG-RQJ.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> sqlalchemy+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/sqlalchemy?hl=en.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> sqlalchemy+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/sqlalchemy?hl=en.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to