[Sqlalchemy-tickets] Issue #3239: literal_binds parameter not applied to LIMIT clause (zzzeek/sqlal
Brought to you by:
zzzeek
|
From: Craig R. <iss...@bi...> - 2014-10-31 22:33:55
|
New issue 3239: literal_binds parameter not applied to LIMIT clause https://bitbucket.org/zzzeek/sqlalchemy/issue/3239/literal_binds-parameter-not-applied-to Craig Radcliffe: I noticed this issue while trying to use sqlalchemy as a query generator to produce a string for input into a system that doesn't accept bind parameters. The literal_binds parameter, when passed through the compile_kwargs parameter in the compile() method, does not seem to apply to a LIMIT clause. Here is a basic example: ``` #!python from sqlalchemy import select from sqlalchemy.sql import table, literal_column t = table("foo") t.append_column(literal_column("bar")) print select([t.c["bar"]]).limit(100).compile(compile_kwargs={'literal_binds': True}) ``` The output is: ``` #! SELECT foo.bar FROM foo LIMIT :param_1 ``` I would expect: ``` #! SELECT foo.bar FROM foo LIMIT 100 ``` Other clauses, including JOINs, WHEREs, GROUP BYs, etc. work as expected. The issue is present in 0.9.8. |