]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added "nowait" flag to Select() [ticket:270]
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Aug 2006 18:48:59 +0000 (18:48 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Aug 2006 18:48:59 +0000 (18:48 +0000)
CHANGES
lib/sqlalchemy/ansisql.py
lib/sqlalchemy/sql.py

diff --git a/CHANGES b/CHANGES
index 23f50312363b81eac046626e198bfefcc4d8868d..d88339419e5db9c5425902f59f2c87143d528b24 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -29,6 +29,7 @@ return an array instead of string for SHOW CREATE TABLE call
 - all create()/drop() calls have a keyword argument of "connectable".
 "engine" is deprecated.
 - fixed ms-sql connect() to work with adodbapi
+- added "nowait" flag to Select()
 
 0.2.6
 - big overhaul to schema to allow truly composite primary and foreign
index 7a76eddbe2e58b14e0a9b809d0a04f9eca1a088c..b85f67d47c8a2ebc1d6d6ddbdd362b375c4b7cfc 100644 (file)
@@ -400,6 +400,9 @@ class ANSICompiler(sql.Compiled):
  
         if select.for_update:
             text += " FOR UPDATE"
+
+        if select.nowait:
+            text += " NOWAIT"
             
         if getattr(select, 'parens', False):
             self.strings[select] = "(" + text + ")"
index 5d3c7692ad93d3b7cfe82568744dc25738a599fe..33250506cfda326ea37b7e200ffb2203a084cf8f 100644 (file)
@@ -1337,6 +1337,7 @@ class CompoundSelect(SelectBaseMixin, FromClause):
         self.parens = kwargs.pop('parens', False)
         self.correlate = kwargs.pop('correlate', False)
         self.for_update = kwargs.pop('for_update', False)
+        self.nowait = kwargs.pop('nowait', False)
         for s in self.selects:
             s.group_by(None)
             s.order_by(None)
@@ -1386,7 +1387,7 @@ class CompoundSelect(SelectBaseMixin, FromClause):
 class Select(SelectBaseMixin, FromClause):
     """represents a SELECT statement, with appendable clauses, as well as 
     the ability to execute itself and return a result set."""
-    def __init__(self, columns=None, whereclause = None, from_obj = [], order_by = None, group_by=None, having=None, use_labels = False, distinct=False, for_update=False, engine=None, limit=None, offset=None, scalar=False, correlate=True):
+    def __init__(self, columns=None, whereclause = None, from_obj = [], order_by = None, group_by=None, having=None, use_labels = False, distinct=False, for_update=False, nowait=False, engine=None, limit=None, offset=None, scalar=False, correlate=True):
         SelectBaseMixin.__init__(self)
         self._froms = util.OrderedDict()
         self.use_labels = use_labels
@@ -1396,6 +1397,7 @@ class Select(SelectBaseMixin, FromClause):
         self.limit = limit
         self.offset = offset
         self.for_update = for_update
+        self.nowait = nowait
 
         # indicates that this select statement should not expand its columns
         # into the column clause of an enclosing select, and should instead