diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-03 19:42:38 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-03 19:42:38 -0400 |
commit | 2b10aa45a101acfcc6090a3801af998ef8fc1a2d (patch) | |
tree | 60329bc3771b31910eb3d1e51412525ed4222066 /lib/sqlalchemy/dialects/postgresql | |
parent | 4399431b53e5d132672431205c654d7d6b32dd77 (diff) | |
download | sqlalchemy-2b10aa45a101acfcc6090a3801af998ef8fc1a2d.tar.gz |
- ensure literal_binds works with LIMIT clause, FOR UPDATE
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index f1418f903..575d2a6dd 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1309,14 +1309,14 @@ class PGCompiler(compiler.SQLCompiler): def visit_sequence(self, seq): return "nextval('%s')" % self.preparer.format_sequence(seq) - def limit_clause(self, select): + def limit_clause(self, select, **kw): text = "" if select._limit_clause is not None: - text += " \n LIMIT " + self.process(select._limit_clause) + text += " \n LIMIT " + self.process(select._limit_clause, **kw) if select._offset_clause is not None: if select._limit_clause is None: text += " \n LIMIT ALL" - text += " OFFSET " + self.process(select._offset_clause) + text += " OFFSET " + self.process(select._offset_clause, **kw) return text def format_from_hint_text(self, sqltext, table, hint, iscrud): @@ -1337,7 +1337,7 @@ class PGCompiler(compiler.SQLCompiler): else: return "" - def for_update_clause(self, select): + def for_update_clause(self, select, **kw): if select._for_update_arg.read: tmp = " FOR SHARE" @@ -1349,7 +1349,7 @@ class PGCompiler(compiler.SQLCompiler): c.table if isinstance(c, expression.ColumnClause) else c for c in select._for_update_arg.of) tmp += " OF " + ", ".join( - self.process(table, ashint=True) + self.process(table, ashint=True, **kw) for table in tables ) |