summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-11-09 19:32:25 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-11-09 19:32:25 +0000
commit0cff22720b4c60c1c305b5ab858c2f453cc66e34 (patch)
tree7039306b58e56efcbcd433be4bbe80d2eb4b7152 /lib/sqlalchemy/sql
parent043379efa5d61626c9a8ab42b15c7687c6e6a0fd (diff)
downloadsqlalchemy-0cff22720b4c60c1c305b5ab858c2f453cc66e34.tar.gz
- Removed the 'properties' attribute of the
Connection object, Connection.info should be used. - Method consoliation in Connection, ExecutionContext
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/compiler.py9
-rw-r--r--lib/sqlalchemy/sql/expression.py6
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 80a4d7f52..b83c9ab20 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -134,6 +134,10 @@ class DefaultCompiler(engine.Compiled):
operators = OPERATORS
functions = FUNCTIONS
+ # if we are insert/update/delete.
+ # set to true when we visit an INSERT, UPDATE or DELETE
+ isdelete = isinsert = isupdate = False
+
def __init__(self, dialect, statement, column_keys=None, inline=False, **kwargs):
"""Construct a new ``DefaultCompiler`` object.
@@ -148,10 +152,7 @@ class DefaultCompiler(engine.Compiled):
statement.
"""
- super(DefaultCompiler, self).__init__(dialect, statement, column_keys, **kwargs)
-
- # if we are insert/update/delete. set to true when we visit an INSERT, UPDATE or DELETE
- self.isdelete = self.isinsert = self.isupdate = False
+ engine.Compiled.__init__(self, dialect, statement, column_keys, **kwargs)
# compile INSERT/UPDATE defaults/sequences inlined (no pre-execute)
self.inline = inline or getattr(statement, 'inline', False)
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index 2fa3fc36f..9b847c78b 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -2551,6 +2551,8 @@ class Alias(FromClause):
baseselectable = baseselectable.element
self.original = baseselectable
self.supports_execution = baseselectable.supports_execution
+ if self.supports_execution:
+ self._autocommit = baseselectable._autocommit
self.element = selectable
if alias is None:
if self.original.named_with_column:
@@ -3453,7 +3455,8 @@ class _UpdateBase(ClauseElement):
"""Form the base for ``INSERT``, ``UPDATE``, and ``DELETE`` statements."""
supports_execution = True
-
+ _autocommit = True
+
def _generate(self):
s = self.__class__.__new__(self.__class__)
s.__dict__ = self.__dict__.copy()
@@ -3606,6 +3609,7 @@ class Delete(_UpdateBase):
class _IdentifiedClause(ClauseElement):
supports_execution = True
+ _autocommit = False
quote = None
def __init__(self, ident):