summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ansisql.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/ansisql.py')
-rw-r--r--lib/sqlalchemy/ansisql.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py
index c44595f36..66b917c20 100644
--- a/lib/sqlalchemy/ansisql.py
+++ b/lib/sqlalchemy/ansisql.py
@@ -394,13 +394,9 @@ class ANSICompiler(sql.Compiled):
text += " ORDER BY " + order_by
text += self.visit_select_postclauses(select)
-
- if select.for_update:
- text += " FOR UPDATE"
- if select.nowait:
- text += " NOWAIT"
-
+ text += self.for_update_clause(select)
+
if getattr(select, 'parens', False):
self.strings[select] = "(" + text + ")"
else:
@@ -415,6 +411,12 @@ class ANSICompiler(sql.Compiled):
""" called when building a SELECT statement, position is after all other SELECT clauses. Most DB syntaxes put LIMIT/OFFSET here """
return (select.limit or select.offset) and self.limit_clause(select) or ""
+ def for_update_clause(self, select):
+ if select.for_update:
+ return " FOR UPDATE"
+ else:
+ return ""
+
def limit_clause(self, select):
text = ""
if select.limit is not None: