Commits

Mike Bayer committed d438410

added "nowait" flag to Select() [ticket:270]

Comments (0)

Files changed (3)

 - 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

lib/sqlalchemy/ansisql.py

  
         if select.for_update:
             text += " FOR UPDATE"
+
+        if select.nowait:
+            text += " NOWAIT"
             
         if getattr(select, 'parens', False):
             self.strings[select] = "(" + text + ")"

lib/sqlalchemy/sql.py

         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)
 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
         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